mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 04:43:34 +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
|
|
@ -42,7 +42,7 @@ void command_history_add(HISTORY_REC *history, const char *text)
|
|||
g_return_if_fail(text != NULL);
|
||||
|
||||
link = g_list_last(history->list);
|
||||
if (link != NULL && strcmp(link->data, text) == 0)
|
||||
if (link != NULL && g_strcmp0(link->data, text) == 0)
|
||||
return; /* same as previous entry */
|
||||
|
||||
if (settings_get_int("max_command_history") < 1 ||
|
||||
|
|
@ -121,7 +121,7 @@ const char *command_history_prev(WINDOW_REC *window, const char *text)
|
|||
}
|
||||
|
||||
if (*text != '\0' &&
|
||||
(pos == NULL || strcmp(pos->data, text) != 0)) {
|
||||
(pos == NULL || g_strcmp0(pos->data, text) != 0)) {
|
||||
/* save the old entry to history */
|
||||
command_history_add(history, text);
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ const char *command_history_next(WINDOW_REC *window, const char *text)
|
|||
}
|
||||
|
||||
if (*text != '\0' &&
|
||||
(pos == NULL || strcmp(pos->data, text) != 0)) {
|
||||
(pos == NULL || g_strcmp0(pos->data, text) != 0)) {
|
||||
/* save the old entry to history */
|
||||
command_history_add(history, text);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue