raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e9802506a071d37899d52248f276ff642c1ef5bd

commit e9802506a071d37899d52248f276ff642c1ef5bd
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Mon Jun 13 19:48:27 2016 +0900

    edje_cc - new vector svg loader - fix bunch of incorrect code that segvs
    
    passing in wrond data type as a void * (no typechecking) like
    node->style instead of node as the function EXPECTED node not
    node->style
    
    also why malloc strlen of string then strcpy when strdup will do? why?
    
    fix!
    
    still doesn't work. i can't display an svg vector at all.
---
 src/bin/edje/edje_svg_loader.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/bin/edje/edje_svg_loader.c b/src/bin/edje/edje_svg_loader.c
index 18ef8fe..7ee5404 100644
--- a/src/bin/edje/edje_svg_loader.c
+++ b/src/bin/edje/edje_svg_loader.c
@@ -60,10 +60,7 @@ _skip_space(const char *str, const char *end)
 static inline char *
 _copy_id(const char* str)
 {
-   char *id = malloc(strlen(str));
-
-   strcpy(id, str);
-   return id;
+   return strdup(str);
 }
 
 static const char *
@@ -677,7 +674,7 @@ _attr_parse_g_node(void *data, const char *key, const char 
*value)
 
    if (!strcmp(key, "style"))
      {
-        return _attr_style_node(node->style, value);
+        return _attr_style_node(node, value);
      }
    else if (!strcmp(key, "transform"))
      {
@@ -763,7 +760,7 @@ _attr_parse_path_node(void *data, const char *key, const 
char *value)
      }
    else if (!strcmp(key, "style"))
      {
-        _attr_style_node(node->style, value);
+        _attr_style_node(node, value);
      }
    else if (!strcmp(key, "id"))
      {
@@ -821,7 +818,7 @@ _attr_parse_circle_node(void *data, const char *key, const 
char *value)
 
    if (!strcmp(key, "style"))
      {
-        _attr_style_node(node->style, value);
+        _attr_style_node(node, value);
      }
    else if (!strcmp(key, "id"))
      {
@@ -884,7 +881,7 @@ _attr_parse_ellipse_node(void *data, const char *key, const 
char *value)
      }
    else if (!strcmp(key, "style"))
      {
-        _attr_style_node(node->style, value);
+        _attr_style_node(node, value);
      }
    else
      {
@@ -948,7 +945,7 @@ _attr_parse_polygon_node(void *data, const char *key, const 
char *value)
      }
    else if (!strcmp(key, "style"))
      {
-        _attr_style_node(node->style, value);
+        _attr_style_node(node, value);
      }
    else if (!strcmp(key, "id"))
      {
@@ -1013,7 +1010,7 @@ _attr_parse_rect_node(void *data, const char *key, const 
char *value)
      }
    else if (!strcmp(key, "style"))
      {
-        _attr_style_node(node->style, value);
+        _attr_style_node(node, value);
      }
    else
      {

-- 


Reply via email to