discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=cb3548f0f6be04ebe587d76332a931d90c59a6e5
commit cb3548f0f6be04ebe587d76332a931d90c59a6e5 Author: Mike Blumenkrantz <[email protected]> Date: Fri Apr 4 13:25:05 2014 -0400 null check xkb parser CID 1193251 --- src/modules/xkbswitch/e_mod_parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/xkbswitch/e_mod_parse.c b/src/modules/xkbswitch/e_mod_parse.c index 275c314..6f815e4 100644 --- a/src/modules/xkbswitch/e_mod_parse.c +++ b/src/modules/xkbswitch/e_mod_parse.c @@ -166,7 +166,7 @@ parse_rules(void) { if (fgets(buf, sizeof(buf), f)) { - char *n, *p, *tmp, *tok, *txt; + char *n, *p, *tmp, *tok, *txt, *c; n = strchr(buf, '\n'); if (n) *n = '\0'; @@ -180,7 +180,9 @@ parse_rules(void) variant->name = eina_stringshare_add(strtok(tmp, " ")); tok = strtok(NULL, " "); - *strchr(tok, ':') = '\0'; + c = strchr(tok, ':'); + if (c) + *c = '\0'; layout = eina_list_search_unsorted(layouts, layout_sort_by_name_cb, tok); layout->variants = eina_list_append(layout->variants, variant); --
