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:
dequis 2015-04-07 22:39:05 -03:00
commit f14199d9c1
57 changed files with 170 additions and 170 deletions

View file

@ -37,12 +37,12 @@ static int commands_equal(COMMAND_REC *rec, COMMAND_REC *rec2)
if (rec2->category == NULL && rec->category != NULL)
return 1;
if (rec->category != NULL && rec2->category != NULL) {
i = strcmp(rec->category, rec2->category);
i = g_strcmp0(rec->category, rec2->category);
if (i != 0)
return i;
}
return strcmp(rec->cmd, rec2->cmd);
return g_strcmp0(rec->cmd, rec2->cmd);
}
static int get_cmd_length(void *data)
@ -176,7 +176,7 @@ static void show_help(const char *data)
if (last != NULL && rec->category != NULL &&
(last->category == NULL ||
strcmp(rec->category, last->category) != 0)) {
g_strcmp0(rec->category, last->category) != 0)) {
/* category changed */
if (items > 0) {
if (!header) {