summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Heron <phil@sanslogic.co.uk>2020-07-05 12:44:07 +0100
committerPhilip Heron <phil@sanslogic.co.uk>2020-07-05 12:44:07 +0100
commit3122b35260b975e982f3b085887e04409a247e43 (patch)
treeeb9cd0887d4f4c44a69835fa382bdbe0db41c153
parent2b79a2f65145222858f58de309fe768db861082a (diff)
Silence strncpy() warning when copying the callsign string
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index 0b4b61b..86797b8 100644
--- a/main.c
+++ b/main.c
@@ -72,7 +72,8 @@ int main(int argc, char *argv[])
case 'c':
if(strlen(optarg) > 6)
fprintf(stderr, "Warning: callsign is longer than 6 characters.\n");
- strncpy(callsign, optarg, 7);
+ strncpy(callsign, optarg, 6);
+ callsign[6] = '\0';
break;
case 'i': image_id = atoi(optarg); break;
case 'q': quality = atoi(optarg); break;