mirror of
https://github.com/irssi/irssi.git
synced 2026-08-14 22:22:15 +02:00
Change all strcmp() to g_strcmp0() to handle nulls gracefully
Just a string replacement (but i did check every one of them)
sed -i 's/strcmp(/g_strcmp0(/g' **/*.c
This commit is contained in:
parent
9ffe52ec5e
commit
f14199d9c1
57 changed files with 170 additions and 170 deletions
|
|
@ -895,7 +895,7 @@ THEME_REC *theme_load(const char *setname)
|
|||
|
||||
name = g_strdup(setname);
|
||||
p = strrchr(name, '.');
|
||||
if (p != NULL && strcmp(p, ".theme") == 0) {
|
||||
if (p != NULL && g_strcmp0(p, ".theme") == 0) {
|
||||
/* remove the trailing .theme */
|
||||
*p = '\0';
|
||||
}
|
||||
|
|
@ -1358,9 +1358,9 @@ static void read_settings(void)
|
|||
|
||||
theme = settings_get_str("theme");
|
||||
len = strlen(current_theme->name);
|
||||
if (strcmp(current_theme->name, theme) != 0 &&
|
||||
if (g_strcmp0(current_theme->name, theme) != 0 &&
|
||||
(strncmp(current_theme->name, theme, len) != 0 ||
|
||||
strcmp(theme+len, ".theme") != 0))
|
||||
g_strcmp0(theme+len, ".theme") != 0))
|
||||
change_theme(theme, TRUE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue