summaryrefslogtreecommitdiff
path: root/legacy/edje
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2009-10-07 10:55:48 +0000
committerCedric BAIL <cedric.bail@free.fr>2009-10-07 10:55:48 +0000
commit8ea901a7535b39dac9a264efbef8021849b5ca05 (patch)
treef2a2157fec873ba74f216c13e91210f723b400a1 /legacy/edje
parentb972f930f76eb3c814e070e2383795219c8761be (diff)
* edje: Remove some potential bug detected by llvm and gcc.
See: http://local.profusion.mobi:8081/~lfelipe/output-efl/ SVN revision: 42930
Diffstat (limited to 'legacy/edje')
-rw-r--r--legacy/edje/src/bin/edje_cc_out.c2
-rw-r--r--legacy/edje/src/bin/edje_cc_sources.c10
-rw-r--r--legacy/edje/src/lib/edje_text.c2
3 files changed, 11 insertions, 3 deletions
diff --git a/legacy/edje/src/bin/edje_cc_out.c b/legacy/edje/src/bin/edje_cc_out.c
index efc1307..2d61736 100644
--- a/legacy/edje/src/bin/edje_cc_out.c
+++ b/legacy/edje/src/bin/edje_cc_out.c
@@ -525,7 +525,7 @@ data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw
525 const char *file = NULL; 525 const char *file = NULL;
526 526
527 evas_object_image_file_get(im, &file, NULL); 527 evas_object_image_file_get(im, &file, NULL);
528 if ((file) && (stat(file, &st) != 0)) 528 if (!file || (stat(file, &st) != 0))
529 st.st_size = 0; 529 st.st_size = 0;
530 *input_bytes += st.st_size; 530 *input_bytes += st.st_size;
531 *input_raw_bytes += im_w * im_h * 4; 531 *input_raw_bytes += im_w * im_h * 4;
diff --git a/legacy/edje/src/bin/edje_cc_sources.c b/legacy/edje/src/bin/edje_cc_sources.c
index 55986a5..2bc255d 100644
--- a/legacy/edje/src/bin/edje_cc_sources.c
+++ b/legacy/edje/src/bin/edje_cc_sources.c
@@ -48,6 +48,7 @@ source_fetch_file(const char *fil, const char *filname)
48 FILE *f; 48 FILE *f;
49 char buf[16 * 1024], *dir = NULL; 49 char buf[16 * 1024], *dir = NULL;
50 long sz; 50 long sz;
51 size_t tmp;
51 ssize_t dir_len = 0; 52 ssize_t dir_len = 0;
52 SrcFile *sf; 53 SrcFile *sf;
53 54
@@ -65,7 +66,14 @@ source_fetch_file(const char *fil, const char *filname)
65 sf = mem_alloc(SZ(SrcFile)); 66 sf = mem_alloc(SZ(SrcFile));
66 sf->name = mem_strdup(filname); 67 sf->name = mem_strdup(filname);
67 sf->file = mem_alloc(sz + 1); 68 sf->file = mem_alloc(sz + 1);
68 fread(sf->file, sz, 1, f); 69 tmp = fread(sf->file, sz, 1, f);
70 if (tmp != sz)
71 {
72 fprintf(stderr, "%s: Warning filename length doesn't match !\n",
73 progname);
74 exit(-1);
75 }
76
69 sf->file[sz] = '\0'; 77 sf->file[sz] = '\0';
70 fseek(f, 0, SEEK_SET); 78 fseek(f, 0, SEEK_SET);
71 srcfiles.list = eina_list_append(srcfiles.list, sf); 79 srcfiles.list = eina_list_append(srcfiles.list, sf);
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index fe1ceb7..003a45a 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -243,7 +243,7 @@ _edje_text_font_get(const char *base, const char *new, char **free_later)
243 243
244 if (base && (!new)) 244 if (base && (!new))
245 return base; 245 return base;
246 else if ((!base) && new) 246 else if (!base)
247 return new; 247 return new;
248 248
249 base_style = strstr(base, ":style="); 249 base_style = strstr(base, ":style=");