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/fe-common/core/keyboard.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/fe-common/core/keyboard.c')
-rw-r--r-- | src/fe-common/core/keyboard.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c index bec1502e..eac8525b 100644 --- a/src/fe-common/core/keyboard.c +++ b/src/fe-common/core/keyboard.c @@ -118,7 +118,7 @@ static CONFIG_NODE *key_config_find(const char *key) for (; tmp != NULL; tmp = config_node_next(tmp)) { node = tmp->data; - if (strcmp(config_node_get_str(node, "key", ""), key) == 0) + if (g_strcmp0(config_node_get_str(node, "key", ""), key) == 0) return node; } @@ -211,7 +211,7 @@ static int expand_combo(const char *start, const char *end, GSList **out) for (tmp = info->keys; tmp != NULL; tmp = tmp->next) { KEY_REC *rec = tmp->data; - if (strcmp(rec->data, str) == 0) + if (g_strcmp0(rec->data, str) == 0) list = g_slist_append(list, rec); } @@ -347,7 +347,7 @@ static void key_states_scan_key(const char *key, KEY_REC *rec) { GSList *tmp, *out; - if (strcmp(rec->info->id, "key") == 0) + if (g_strcmp0(rec->info->id, "key") == 0) return; out = g_slist_append(NULL, g_string_new(NULL)); @@ -383,7 +383,7 @@ static void key_states_rescan(void) g_tree_foreach(key_states, (GTraverseFunc) key_state_destroy, NULL); g_tree_destroy(key_states); - key_states = g_tree_new((GCompareFunc) strcmp); + key_states = g_tree_new((GCompareFunc) g_strcmp0); temp = g_string_new(NULL); g_hash_table_foreach(keys, (GHFunc) key_states_scan_key, temp); @@ -860,7 +860,7 @@ void keyboard_init(void) default_keys = g_hash_table_new((GHashFunc) g_str_hash, (GCompareFunc) g_str_equal); keyinfos = NULL; - key_states = g_tree_new((GCompareFunc) strcmp); + key_states = g_tree_new((GCompareFunc) g_strcmp0); key_config_frozen = 0; memset(used_keys, 0, sizeof(used_keys)); |