aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-06 22:09:50 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-06 22:09:50 +0200
commit7bb346f23c5f7a31f210fe95dcba093d0dc51571 (patch)
tree2239fc7d76b743ada2f8836a3722f36a3981eee3
parent8d680b51148b9cbe7dd3afd37022f3390dd999ef (diff)
downloadbusybox-w32-7bb346f23c5f7a31f210fe95dcba093d0dc51571.tar.gz
busybox-w32-7bb346f23c5f7a31f210fe95dcba093d0dc51571.tar.bz2
busybox-w32-7bb346f23c5f7a31f210fe95dcba093d0dc51571.zip
*: use {i,u}toa() where appropriate
function old new delta startservice 377 363 -14 setari_u 54 40 -14 ash_main 1375 1361 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-42) Total: -42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/cal.c2
-rw-r--r--editors/awk.c4
-rw-r--r--miscutils/fbsplash.c4
-rw-r--r--runit/runsv.c6
-rw-r--r--shell/ash.c4
5 files changed, 6 insertions, 14 deletions
diff --git a/coreutils/cal.c b/coreutils/cal.c
index 9b597772e..ef70b0e35 100644
--- a/coreutils/cal.c
+++ b/coreutils/cal.c
@@ -147,7 +147,7 @@ int cal_main(int argc, char **argv)
147 unsigned *dp; 147 unsigned *dp;
148 char lineout[80]; 148 char lineout[80];
149 149
150 sprintf(lineout, "%d", year); 150 sprintf(lineout, "%u", year);
151 center(lineout, 151 center(lineout,
152 (WEEK_LEN * 3 + HEAD_SEP * 2) 152 (WEEK_LEN * 3 + HEAD_SEP * 2)
153 + julian * (J_WEEK_LEN * 2 + HEAD_SEP 153 + julian * (J_WEEK_LEN * 2 + HEAD_SEP
diff --git a/editors/awk.c b/editors/awk.c
index d15dbb3e5..17244f9e6 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -765,11 +765,9 @@ static var *setvar_u(var *v, const char *value)
765/* set array element to user string */ 765/* set array element to user string */
766static void setari_u(var *a, int idx, const char *s) 766static void setari_u(var *a, int idx, const char *s)
767{ 767{
768 char sidx[sizeof(int)*3 + 1];
769 var *v; 768 var *v;
770 769
771 sprintf(sidx, "%d", idx); 770 v = findvar(iamarray(a), itoa(idx));
772 v = findvar(iamarray(a), sidx);
773 setvar_u(v, s); 771 setvar_u(v, s);
774} 772}
775 773
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c
index ec0f092dc..3d225e549 100644
--- a/miscutils/fbsplash.c
+++ b/miscutils/fbsplash.c
@@ -391,9 +391,7 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
391 num = atoi(num_buf); 391 num = atoi(num_buf);
392 if (isdigit(num_buf[0]) && (num <= 100)) { 392 if (isdigit(num_buf[0]) && (num <= 100)) {
393#if DEBUG 393#if DEBUG
394 char strVal[10]; 394 DEBUG_MESSAGE(itoa(num));
395 sprintf(strVal, "%d", num);
396 DEBUG_MESSAGE(strVal);
397#endif 395#endif
398 fb_drawprogressbar(num); 396 fb_drawprogressbar(num);
399 } 397 }
diff --git a/runit/runsv.c b/runit/runsv.c
index 4dfdd3dc1..8b787543f 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -311,7 +311,6 @@ static void startservice(struct svdir *s)
311 int p; 311 int p;
312 const char *arg[4]; 312 const char *arg[4];
313 char exitcode[sizeof(int)*3 + 2]; 313 char exitcode[sizeof(int)*3 + 2];
314 char sigcode[sizeof(int)*3 + 2];
315 314
316 if (s->state == S_FINISH) { 315 if (s->state == S_FINISH) {
317/* Two arguments are given to ./finish. The first one is ./run exit code, 316/* Two arguments are given to ./finish. The first one is ./run exit code,
@@ -324,13 +323,12 @@ static void startservice(struct svdir *s)
324 arg[0] = "./finish"; 323 arg[0] = "./finish";
325 arg[1] = "-1"; 324 arg[1] = "-1";
326 if (WIFEXITED(s->wstat)) { 325 if (WIFEXITED(s->wstat)) {
327 sprintf(exitcode, "%u", (int) WEXITSTATUS(s->wstat)); 326 *utoa_to_buf(WEXITSTATUS(s->wstat), exitcode, sizeof(exitcode)) = '\0';
328 arg[1] = exitcode; 327 arg[1] = exitcode;
329 } 328 }
330 //arg[2] = "0"; 329 //arg[2] = "0";
331 //if (WIFSIGNALED(s->wstat)) { 330 //if (WIFSIGNALED(s->wstat)) {
332 sprintf(sigcode, "%u", (int) WTERMSIG(s->wstat)); 331 arg[2] = utoa(WTERMSIG(s->wstat));
333 arg[2] = sigcode;
334 //} 332 //}
335 arg[3] = NULL; 333 arg[3] = NULL;
336 } else { 334 } else {
diff --git a/shell/ash.c b/shell/ash.c
index 44d3a99a7..2e7228d3c 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -13083,7 +13083,6 @@ init(void)
13083 /* from var.c: */ 13083 /* from var.c: */
13084 { 13084 {
13085 char **envp; 13085 char **envp;
13086 char ppid[sizeof(int)*3 + 2];
13087 const char *p; 13086 const char *p;
13088 struct stat st1, st2; 13087 struct stat st1, st2;
13089 13088
@@ -13094,8 +13093,7 @@ init(void)
13094 } 13093 }
13095 } 13094 }
13096 13095
13097 sprintf(ppid, "%u", (unsigned) getppid()); 13096 setvar("PPID", utoa(getppid()), 0);
13098 setvar("PPID", ppid, 0);
13099 13097
13100 p = lookupvar("PWD"); 13098 p = lookupvar("PWD");
13101 if (p) 13099 if (p)