From 81b45f92c835f9012b28d8683ec16550be65279c Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 21 Jan 2024 14:09:46 -0500 Subject: [PATCH] static analyzer bit in sounds.c --- src/sounds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sounds.c b/src/sounds.c index 2b2d68932..3ff3ce7e5 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1555,6 +1555,9 @@ add_sound_mapping(const char* mapping) int volume, idx = -1; msgtyp[0] = '\0'; + filename[sizeof filename - 1] = '\0'; + filespec[sizeof filespec - 1] = '\0'; + text[sizeof text - 1] = '\0'; if (sscanf(mapping, "MESG \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d %d", text, filename, &volume, &idx) == 4 || sscanf(mapping, "MESG %10[^\"] \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d %d",