Fix possible unterminated string

sym_SetMacroArgID used a `sprintf` that could write no \0.
In practice this was benign because %u cannot print 256 chars,
but better future-proof this.
This commit is contained in:
ISSOtm
2019-08-31 03:00:26 +02:00
parent a21cef7190
commit 02191135a0

View File

@@ -440,7 +440,7 @@ void sym_SetMacroArgID(uint32_t nMacroCount)
{
char s[256];
snprintf(s, sizeof(s), "_%u", nMacroCount);
snprintf(s, sizeof(s) - 1, "_%u", nMacroCount);
newmacroargs[MAXMACROARGS] = strdup(s);
}