mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-05 09:46:28 +00:00
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
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:
parent
2fcf14d08d
commit
fa3bad7177
2 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue