Silence strncpy() warning when copying the callsign string

This commit is contained in:
Philip Heron 2020-07-05 12:44:07 +01:00
parent 2b79a2f651
commit 3122b35260
1 changed files with 2 additions and 1 deletions

3
main.c
View File

@ -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;