mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-25 19:42:20 +00:00
don't allow escape characters in names
This commit is contained in:
parent
d71ef89dbb
commit
6ddb7388cc
2 changed files with 7 additions and 1 deletions
|
|
@ -749,6 +749,11 @@ NEXT_OPTION:
|
|||
|
||||
if (gCLIOpts.playerName[0]) { snprintf(configPlayerName, MAX_CONFIG_STRING, "%s", gCLIOpts.playerName); }
|
||||
|
||||
bool djui_panel_player_name_valid(char* buffer);
|
||||
if (!djui_panel_player_name_valid(configPlayerName)) {
|
||||
snprintf(configPlayerName, MAX_CONFIG_STRING, "Player");
|
||||
}
|
||||
|
||||
for (int i = 0; i < gCLIOpts.enabledModsCount; i++) {
|
||||
enable_mod(gCLIOpts.enableMods[i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,11 +327,12 @@ static void djui_panel_player_edit_palette_create(struct DjuiBase* caller) {
|
|||
// player panel //
|
||||
//////////////////
|
||||
|
||||
static bool djui_panel_player_name_valid(char* buffer) {
|
||||
bool djui_panel_player_name_valid(char* buffer) {
|
||||
if (buffer[0] == '\0') { return false; }
|
||||
char* c = buffer;
|
||||
while (*c != '\0') {
|
||||
if (*c == ' ') { return false; }
|
||||
if (*c == '\\') { return false; }
|
||||
if (!djui_unicode_valid_char(c)) { return false; }
|
||||
c = djui_unicode_next_char(c);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue