diff options
author | Willy Tarreau <w@1wt.eu> | 2022-02-07 17:23:26 +0100 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2022-04-20 17:05:43 -0700 |
commit | 56d68a3c1f41ca0843fd9151654c35f4925d911b (patch) | |
tree | dbaa391060f6bbab4865adc04978c4349ceb3c8f /tools/include/nolibc/nolibc.h | |
parent | eba6d00d38e7c26dd5b948ed75200d05f67d8266 (diff) | |
download | linux-56d68a3c1f41ca0843fd9151654c35f4925d911b.tar.bz2 |
tools/nolibc/stdlib: move ltoa() to stdlib.h
This function is not standard and performs the opposite of atol(). Let's
move it with atol(). It's been split between a reentrant function and one
using a static buffer.
There's no more definition in nolibc.h anymore now.
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include/nolibc/nolibc.h')
-rw-r--r-- | tools/include/nolibc/nolibc.h | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 23fb81414b1b..a349c88c45ff 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -94,26 +94,4 @@ /* Used by programs to avoid std includes */ #define NOLIBC -static __attribute__((unused)) -const char *ltoa(long in) -{ - /* large enough for -9223372036854775808 */ - static char buffer[21]; - char *pos = buffer + sizeof(buffer) - 1; - int neg = in < 0; - unsigned long n = neg ? -in : in; - - *pos-- = '\0'; - do { - *pos-- = '0' + n % 10; - n /= 10; - if (pos < buffer) - return pos + 1; - } while (n); - - if (neg) - *pos-- = '-'; - return pos + 1; -} - #endif /* _NOLIBC_H */ |