mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 11:32:07 +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:
@@ -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