summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/hush.c7
-rw-r--r--include/libbb.h2
-rw-r--r--lib/libbb.c14
3 files changed, 6 insertions, 17 deletions
diff --git a/common/hush.c b/common/hush.c
index dab9b04081..68c3eccdfc 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 {
diff --git a/include/libbb.h b/include/libbb.h
index 1f6afaa27a..d05c190637 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -29,6 +29,4 @@ char * safe_strncpy(char *dst, const char *src, size_t size);
int process_escape_sequence(const char *source, char *dest, int destlen);
-char *simple_itoa(unsigned int i);
-
#endif /* __LIBBB_H */
diff --git a/lib/libbb.c b/lib/libbb.c
index 239611c27b..d0c9bf4d80 100644
--- a/lib/libbb.c
+++ b/lib/libbb.c
@@ -112,17 +112,3 @@ char * safe_strncpy(char *dst, const char *src, size_t size)
return strncpy(dst, src, size);
}
EXPORT_SYMBOL(safe_strncpy);
-
-char *simple_itoa(unsigned int i)
-{
- /* 21 digits plus null terminator, good for 64-bit or smaller ints */
- static char local[22];
- char *p = &local[21];
- *p-- = '\0';
- do {
- *p-- = '0' + i % 10;
- i /= 10;
- } while (i > 0);
- return p + 1;
-}
-EXPORT_SYMBOL(simple_itoa);