projects
/
platform
/
upstream
/
enlightenment.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c17d333
)
null check xkb parser
author
Mike Blumenkrantz
<zmike@samsung.com>
Fri, 4 Apr 2014 17:25:05 +0000
(13:25 -0400)
committer
Mike Blumenkrantz
<zmike@samsung.com>
Fri, 4 Apr 2014 19:04:27 +0000
(15:04 -0400)
CID
1193251
src/modules/xkbswitch/e_mod_parse.c
patch
|
blob
|
history
diff --git
a/src/modules/xkbswitch/e_mod_parse.c
b/src/modules/xkbswitch/e_mod_parse.c
index 275c31454c2f0c4ad5a7a197ce49ca7a09687294..6f815e443d5321a2a9e1cf869d35127d6aa7ae26 100644
(file)
--- 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);