From 3122b35260b975e982f3b085887e04409a247e43 Mon Sep 17 00:00:00 2001 From: Philip Heron Date: Sun, 5 Jul 2020 12:44:07 +0100 Subject: [PATCH] Silence strncpy() warning when copying the callsign string --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;