summaryrefslogtreecommitdiff
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-11-12 10:14:24 -0500
committerTom Rini <trini@konsulko.com>2021-11-12 10:14:24 -0500
commit515bf78ff975d474f895bf86b4e16eade51c8dbd (patch)
tree49114762efa8154f2a2f75d8718cf650e7f0fc09 /lib/vsprintf.c
parent1e72ad6b387c599f477f83cda67ab525c089a9b0 (diff)
parent6f84e809d9a373961d34f5b408bf44702b8c978c (diff)
Merge branch '2021-11-12-assorted-updates'
- A number of pxe related cleanups and related re-organization. - A few related pxe/sysboot/extlinux improvements - Remove some dead code. - Update Azure to use a newer Windows build environment - Add a .get_maintainer.conf file - A few minor TI SoC platform updates
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index d7ee35b4773..e634bd70b66 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -816,11 +816,12 @@ int vprintf(const char *fmt, va_list args)
}
#endif
+static char local_toa[22];
+
char *simple_itoa(ulong i)
{
/* 21 digits plus null terminator, good for 64-bit or smaller ints */
- static char local[22];
- char *p = &local[21];
+ char *p = &local_toa[21];
*p-- = '\0';
do {
@@ -830,6 +831,21 @@ char *simple_itoa(ulong i)
return p + 1;
}
+char *simple_xtoa(ulong num)
+{
+ /* 16 digits plus nul terminator, good for 64-bit or smaller ints */
+ char *p = &local_toa[17];
+
+ *--p = '\0';
+ do {
+ p -= 2;
+ hex_byte_pack(p, num & 0xff);
+ num >>= 8;
+ } while (num > 0);
+
+ return p;
+}
+
/* We don't seem to have %'d in U-Boot */
void print_grouped_ull(unsigned long long int_val, int digits)
{