mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-05 11:45:36 +00:00
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:
1 parent
a21cef7190
commit
02191135a0
1 file changed
+1
-1
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user