Use snprintf in place of sprintf.

This commit is contained in:
Mike Brady
2018-04-08 15:36:05 +01:00
parent 1c437f1aab
commit 08a7d4ffb5
11 changed files with 80 additions and 38 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ static void resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIn
#ifdef CONFIG_METADATA
char portstring[20];
memset(portstring, 0, sizeof(portstring));
sprintf(portstring, "%u", port);
snprintf(portstring, sizeof(portstring), "%u", port);
send_ssnc_metadata('dapo', strdup(portstring), strlen(portstring), 0);
#endif
}