static analyzer bit in sounds.c

This commit is contained in:
nhmall
2024-01-21 14:09:46 -05:00
parent 9e640fb14e
commit 81b45f92c8

View File

@@ -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",