From 174fb7399c570b69784ae8f099e201a15ba1809c Mon Sep 17 00:00:00 2001 From: cedric Date: Wed, 25 Feb 2009 17:08:17 +0000 Subject: [PATCH] * edje: Remove snprintf("%i") for an eina itoa. 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bin/edje_cc_out.c b/src/bin/edje_cc_out.c index 536ab0b..2db802f 100644 --- a/src/bin/edje_cc_out.c +++ b/src/bin/edje_cc_out.c @@ -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); } } -- 2.7.4