* edje: Remove snprintf("%i") for an eina itoa.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Feb 2009 17:08:17 +0000 (17:08 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Feb 2009 17:08:17 +0000 (17:08 +0000)
NOTE: When you just want to convert from an int to a string,
better use eina for that.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@39213 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_cc_out.c

index 536ab0b..2db802f 100644 (file)
@@ -1354,18 +1354,17 @@ data_process_script_lookups(void)
 
    EINA_LIST_FOREACH(code_lookups, l, cl)
      {
-       char buf[256];
-       int i, n;
+       char buf[12];
+       int n;
 
-       snprintf(buf, sizeof(buf), "%i", cl->val);
-       n = strlen(buf);
+       n = eina_convert_itoa(cl->val, buf);
        if (n > cl->len)
          {
             fprintf(stderr, "%s: Error. The unexpected happened. A numeric replacement string was larger than the original!\n",
                     progname);
             exit(-1);
          }
-       for (i = 0; i < cl->len; i++) cl->ptr[i] = ' ';
+       memset(cl->ptr, ' ', cl->len);
        strncpy(cl->ptr, buf, n);
      }
 }