handle smlua text utils crashing
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled

This commit is contained in:
Isaac0-dev 2026-02-26 12:18:17 +10:00
parent 2fcf14d08d
commit fa3bad7177
2 changed files with 3 additions and 2 deletions

View file

@ -153,7 +153,7 @@ static const char *ascii_to_sm64_char(u8 *str64, const char *strAscii, bool menu
if (menu && !ch->menu) {
continue;
}
if (memcmp(strAscii, ch->str, ch->len) == 0) {
if (strncmp(strAscii, ch->str, ch->len) == 0) {
*str64 = ch->c;
return strAscii + ch->len;
}

View file

@ -112,7 +112,8 @@ static u8* smlua_text_utils_convert(const char* str) {
// Checks the first 3 characters
static bool str_starts_with_spaces(const char* str) {
for (u8 i = 0; i < 3; i++) {
if (str[i] != ' ') { return false; }
if (str[i] == '\0') { return false; }
if (str[i] != ' ') { return false; }
}
return true;
}