summaryrefslogtreecommitdiffstats
path: root/common/hush.c
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-05-27 22:52:57 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2019-05-28 10:18:14 +0200
commitfaf2ad1dc5a1a3fb131559c26675cecdd20b74a8 (patch)
tree037a0f2deb846207d0db6468e2d85338211c8ee0 /common/hush.c
parent8f945131a18e68121f6e7ea4c12992a5eb108466 (diff)
downloadbarebox-faf2ad1dc5a1a3fb131559c26675cecdd20b74a8.tar.gz
libbb: Drop simple_itoa()
Hush is the only one user of simple_itoa() and the code there can be re-implemented using snprintf(). Change the code to get rid of simple_itoa(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/hush.c')
-rw-r--r--common/hush.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/hush.c b/common/hush.c
index dab9b04..68c3ecc 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -402,7 +402,12 @@ static void b_free(o_string *o)
static int b_adduint(o_string *o, unsigned int i)
{
int r;
- char *p = simple_itoa(i);
+ /* 21 digits plus null terminator, good for 64-bit or smaller
+ * ints */
+ char number[22];
+ char *p = number;
+
+ snprintf(number, sizeof(number), "%u", i);
/* no escape checking necessary */
do {