diff options
author | dequis <dx@dxzone.com.ar> | 2015-04-07 22:39:05 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-04-07 22:41:05 -0300 |
commit | f14199d9c15a8062b5663fa6fcdae00390473b15 (patch) | |
tree | 730f9fdb49b2e1f26dd56422f83e6b6ab9867d8a /src/core/log.c | |
parent | 9ffe52ec5e3f0643e7ddd12f4d21c0788d2f8cea (diff) | |
download | irssi-f14199d9c15a8062b5663fa6fcdae00390473b15.zip |
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
Diffstat (limited to 'src/core/log.c')
-rw-r--r-- | src/core/log.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/log.c b/src/core/log.c index d4d3853e..35e42544 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -110,7 +110,7 @@ int log_start_logging(LOG_REC *log) log->real_fname = log_filename(log); if (log->real_fname != NULL && - strcmp(log->real_fname, log->fname) != 0) { + g_strcmp0(log->real_fname, log->fname) != 0) { /* path may contain variables (%time, $vars), make sure the directory is created */ dir = g_path_get_dirname(log->real_fname); @@ -181,7 +181,7 @@ static void log_rotate_check(LOG_REC *log) return; new_fname = log_filename(log); - if (strcmp(new_fname, log->real_fname) != 0) { + if (g_strcmp0(new_fname, log->real_fname) != 0) { /* rotate log */ log_stop_logging(log); signal_emit("log rotated", 1, log); @@ -245,7 +245,7 @@ static int itemcmp(const char *patt, const char *item) { /* returns 0 on match, nonzero otherwise */ - if (!strcmp(patt, "*")) + if (!g_strcmp0(patt, "*")) return 0; return item ? g_ascii_strcasecmp(patt, item) : 1; } @@ -320,7 +320,7 @@ LOG_REC *log_find(const char *fname) for (tmp = logs; tmp != NULL; tmp = tmp->next) { LOG_REC *rec = tmp->data; - if (strcmp(rec->fname, fname) == 0) + if (g_strcmp0(rec->fname, fname) == 0) return rec; } |