summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-11-23 12:56:06 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-11-23 12:56:06 +0000
commit725d212f483fb5c13c55d491c6d099d3dbfc798d (patch)
tree881586c3642f7cc125684339357a1ea40a3cb80a
parent4365d69079b3161a135909bfe79e32573c356c0d (diff)
handle NULL strings better - need to handle mroe NULLS though
SVN revision: 18617
Diffstat (limited to '')
-rw-r--r--legacy/edje/src/lib/edje_message_queue.c10
-rw-r--r--legacy/edje/src/lib/edje_program.c6
-rw-r--r--legacy/edje/src/lib/edje_text.c3
-rw-r--r--legacy/edje/src/lib/edje_util.c9
4 files changed, 15 insertions, 13 deletions
diff --git a/legacy/edje/src/lib/edje_message_queue.c b/legacy/edje/src/lib/edje_message_queue.c
index 65f7f7b5d7..fab904f3d5 100644
--- a/legacy/edje/src/lib/edje_message_queue.c
+++ b/legacy/edje/src/lib/edje_message_queue.c
@@ -242,8 +242,8 @@ _edje_message_free(Edje_Message *em)
242 Edje_Message_Signal *emsg; 242 Edje_Message_Signal *emsg;
243 243
244 emsg = (Edje_Message_Signal *)em->msg; 244 emsg = (Edje_Message_Signal *)em->msg;
245 free(emsg->sig); 245 if (emsg->sig) free(emsg->sig);
246 free(emsg->src); 246 if (emsg->src) free(emsg->src);
247 free(emsg); 247 free(emsg);
248 } 248 }
249 break; 249 break;
@@ -292,9 +292,9 @@ _edje_message_send(Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id, v
292 Edje_Message_Signal *emsg2, *emsg3; 292 Edje_Message_Signal *emsg2, *emsg3;
293 293
294 emsg2 = (Edje_Message_Signal *)emsg; 294 emsg2 = (Edje_Message_Signal *)emsg;
295 emsg3 = malloc(sizeof(Edje_Message_Signal)); 295 emsg3 = calloc(1, sizeof(Edje_Message_Signal));
296 emsg3->sig = strdup(emsg2->sig); 296 if (emsg2->sig) emsg3->sig = strdup(emsg2->sig);
297 emsg3->src = strdup(emsg2->src); 297 if (emsg2->src) emsg3->src = strdup(emsg2->src);
298 msg = (unsigned char *)emsg3; 298 msg = (unsigned char *)emsg3;
299 } 299 }
300 break; 300 break;
diff --git a/legacy/edje/src/lib/edje_program.c b/legacy/edje/src/lib/edje_program.c
index 86d3691b99..178ca97cee 100644
--- a/legacy/edje/src/lib/edje_program.c
+++ b/legacy/edje/src/lib/edje_program.c
@@ -234,7 +234,7 @@ edje_object_animation_set(Evas_Object *obj, int on)
234 } 234 }
235 else 235 else
236 { 236 {
237 _edje_emit(ed, "load", ""); 237 _edje_emit(ed, "load", NULL);
238 if (evas_object_visible_get(obj)) 238 if (evas_object_visible_get(obj))
239 { 239 {
240 evas_object_hide(obj); 240 evas_object_hide(obj);
@@ -811,9 +811,7 @@ _edje_emit_handle(Edje *ed, char *sig, char *src)
811 Edje_Program *pr; 811 Edje_Program *pr;
812 812
813 pr = l->data; 813 pr = l->data;
814 if ((pr->signal) && 814 if ((_edje_glob_match(sig, pr->signal)) &&
815 (pr->source) &&
816 (_edje_glob_match(sig, pr->signal)) &&
817 (_edje_glob_match(src, pr->source))) 815 (_edje_glob_match(src, pr->source)))
818 { 816 {
819#ifdef EDJE_PROGRAM_CACHE 817#ifdef EDJE_PROGRAM_CACHE
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index 042e67c773..9a5a93c6a2 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -513,6 +513,9 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
513 text = chosen_desc->text.text; 513 text = chosen_desc->text.text;
514 font = chosen_desc->text.font; 514 font = chosen_desc->text.font;
515 size = chosen_desc->text.size; 515 size = chosen_desc->text.size;
516
517 if (!text) text = "";
518 if (!font) font = "";
516 519
517 if ((chosen_desc->text.text_class) && (chosen_desc->text.text_class[0] != 0)) 520 if ((chosen_desc->text.text_class) && (chosen_desc->text.text_class[0] != 0))
518 { 521 {
diff --git a/legacy/edje/src/lib/edje_util.c b/legacy/edje/src/lib/edje_util.c
index 54f4b3e21f..424fb9aa2f 100644
--- a/legacy/edje/src/lib/edje_util.c
+++ b/legacy/edje/src/lib/edje_util.c
@@ -1587,13 +1587,14 @@ _edje_fetch(Evas_Object *obj)
1587int 1587int
1588_edje_glob_match(char *str, char *glob) 1588_edje_glob_match(char *str, char *glob)
1589{ 1589{
1590 if (glob[0] == 0) 1590 if ((!glob) || (glob[0] == 0))
1591 { 1591 {
1592 if (str[0] == 0) return 1; 1592 if ((!str) || (str[0] == 0)) return 1;
1593 if ((glob) && (glob[0] == '*')) return 1;
1593 return 0; 1594 return 0;
1594 } 1595 }
1595 if (!strcmp(glob, "*")) return 1; 1596 if (glob[0] == '*') return 1;
1596 if (!fnmatch(glob, str, 0)) return 1; 1597 if ((glob) && (str) && (!fnmatch(glob, str, 0))) return 1;
1597 return 0; 1598 return 0;
1598} 1599}
1599 1600