Fix some UB exposed with GCC 10.1.0

This commit is contained in:
PikalaxALT
2020-07-11 10:22:34 -04:00
parent 038d247e14
commit 535189bf14
3 changed files with 9 additions and 8 deletions
+4
View File
@@ -4521,7 +4521,11 @@ static void UnusedPrintMonName(u8 windowId, const u8* name, u8 left, u8 top)
;
for (i = 0; i < nameLength; i++)
str[ARRAY_COUNT(str) - nameLength + i] = name[i];
#ifdef UBFIX
str[ARRAY_COUNT(str) - 1] = EOS;
#else
str[ARRAY_COUNT(str)] = EOS;
#endif
PrintInfoSubMenuText(windowId, str, left, top);
}