mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-12-07 16:42:36 +00:00
prevent only escape characters
This commit is contained in:
parent
c3c4ba6b0a
commit
a1f96a97fa
1 changed files with 3 additions and 0 deletions
|
|
@ -330,13 +330,16 @@ static void djui_panel_player_edit_palette_create(struct DjuiBase* caller) {
|
|||
bool djui_panel_player_name_valid(char* buffer) {
|
||||
if (buffer[0] == '\0') { return false; }
|
||||
u16 numEscapeChars = 0;
|
||||
bool isOnlyEscapeChars = true;
|
||||
char* c = buffer;
|
||||
while (*c != '\0') {
|
||||
if (*c == ' ') { return false; }
|
||||
if (!djui_unicode_valid_char(c)) { return false; }
|
||||
if (*c == '\\') { numEscapeChars++; }
|
||||
else { isOnlyEscapeChars = false; }
|
||||
c = djui_unicode_next_char(c);
|
||||
}
|
||||
if (isOnlyEscapeChars) { return false; }
|
||||
if (numEscapeChars % 2 != 0) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue