diff options
author | Simon Glass <sjg@chromium.org> | 2011-10-21 18:51:33 +0000 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2011-11-16 18:18:43 -0800 |
commit | 1c1cd642bedc8d27b1a6d1cfed7b972c9f0d90a5 (patch) | |
tree | 241d782ee17764ee54815022ceb565ffde913549 /common/hush.c | |
parent | 69e4e2063641b549a1798b02c40610f4d99bf40c (diff) |
UPSTREAM: Move simple_itoa to vsprintf
This function is generally useful and shouldn't hide away in hush. It
has been moved as is.
Signed-off-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit 3cce8a5496452285e1828984ad3945417205cfc3)
Change-Id: I014f58e901e6b035b5eeb694c62e6e881a7b75c2
Reviewed-on: https://gerrit.chromium.org/gerrit/11791
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/hush.c')
-rw-r--r-- | common/hush.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/common/hush.c b/common/hush.c index 85a603071f1..9bdb499f9d8 100644 --- a/common/hush.c +++ b/common/hush.c @@ -17,7 +17,6 @@ * Erik W. Troan, which they placed in the public domain. I don't know * how much of the Johnson/Troan code has survived the repeated rewrites. * Other credits: - * simple_itoa() was lifted from boa-0.93.15 * b_addchr() derived from similar w_addchar function in glibc-2.2 * setup_redirect(), redirect_opt_num(), and big chunks of main() * and many builtins derived from contributions by Erik Andersen @@ -922,20 +921,6 @@ static int b_addqchr(o_string *o, int ch, int quote) return b_addchr(o, ch); } -/* belongs in utility.c */ -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; -} - #ifndef __U_BOOT__ static int b_adduint(o_string *o, unsigned int i) { |