]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/nolibc/printf: Prepend sign to converted number
authorDavid Laight <david.laight.linux@gmail.com>
Sun, 8 Mar 2026 11:37:36 +0000 (11:37 +0000)
committerThomas Weißschuh <linux@weissschuh.net>
Fri, 20 Mar 2026 16:55:51 +0000 (17:55 +0100)
commit8df70ee45b1383114cdcaa9b2fe7449cdf5f46d5
treeb8fb1defd5ac9ab9b050522c46cd9531031d359c
parentb43be424343407661d5e7c79a3584a37b91a88bb
tools/nolibc/printf: Prepend sign to converted number

Instead of appending the converted number to the sign, convert first
and then prepend the sign (or "0x").
Use the length returned by u64toh_r() instead of calling strlen().

Needed so that zero padding can be inserted between the sign and digits
in an upcoming patch.

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260308113742.12649-12-david.laight.linux@gmail.com
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/include/nolibc/stdio.h