Add a bugfix for unsafe usage of sprintf

Thanks, Gabe
This commit is contained in:
Clownacy 2019-06-27 17:50:19 +00:00
parent d1c7cd53df
commit 941dec2c7c

View file

@ -1310,7 +1310,11 @@ int TextScriptProc()
//Print text
PutText2(0, 0, str, RGB(0xFF, 0xFF, 0xFE), (Surface_Ids)(gTS.line % 4 + SURFACE_ID_TEXT_LINE1));
sprintf(&text[gTS.line % 4 * 0x40], str);
#ifdef FIX_BUGS
strcpy(&text[gTS.line % 4 * 0x40], str);
#else
sprintf(&text[gTS.line % 4 * 0x40], str); // No point to using an sprintf here, and it makes Clang mad
#endif
//Check if should move to next line (prevent a memory overflow, come on guys, this isn't a leftover of pixel trying to make text wrapping)
gTS.p_read += y;