Skip to content

Commit

Permalink
Replace stricmp with strcasecmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rickgaiser committed Dec 5, 2020
1 parent 41f7cf0 commit 21ff6b1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ int lngFindGuiID(const char *lang)
if (lang) {
int i = 0;
for (; i < nLanguages; i++) {
if (stricmp(languages[i].name, lang) == 0)
if (strcasecmp(languages[i].name, lang) == 0)
return i + 1; // shift for Gui id
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/menusys.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ void submenuSort(submenu_list_t **submenu)
char *txt1 = submenuItemGetText(&tip->item);
char *txt2 = submenuItemGetText(&nxt->item);

int cmp = stricmp(txt1, txt2);
int cmp = strcasecmp(txt1, txt2);

if (cmp > 0) {
swap(tip, nxt);
Expand Down
2 changes: 1 addition & 1 deletion src/supportbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int isValidIsoName(char *name, int *pNameLen)

// Minimum is 17 char, GameID (11) + "." (1) + filename (1 min.) + ".iso" (4)
int size = strlen(name);
if (stricmp(&name[size - 4], ".iso") == 0) {
if (strcasecmp(&name[size - 4], ".iso") == 0) {
if ((size >= 17) && (name[4] == '_') && (name[8] == '.') && (name[11] == '.')) {
*pNameLen = size - 16;
return GAME_FORMAT_OLD_ISO;
Expand Down
2 changes: 1 addition & 1 deletion src/themes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ int thmFindGuiID(const char *theme)
if (theme) {
int i = 0;
for (; i < nThemes; i++) {
if (stricmp(themes[i].name, theme) == 0)
if (strcasecmp(themes[i].name, theme) == 0)
return i + 1;
}
}
Expand Down

0 comments on commit 21ff6b1

Please sign in to comment.