[PATCH 0/5] assorted printf-related patches

Rasmus Villemoes rasmus.villemoes at prevas.dk
Thu May 20 12:05:23 CEST 2021

The first patch ensures that vsnprintf() never returns a negative
value. Finding (indirect) callers and having them all handle that
would be a whack-a-mole game for no real gain. Even if the callers
don't directly use the return value, they might rely on vsnprintf()
always producing a nul-terminated string, which is not the case if we
do an early "return -Esomething".

The last fixes a bug I found while looking for impact of %pD returning
a negative value.

The second and fourth reduce the size of vsprintf.o a little.

Rasmus Villemoes (5):
  lib/vsprintf.c: make sure vsnprintf() never returns a negative value
  lib/vsprintf.c: implement printf() in terms of vprintf()
  lib/vsprintf.c: remove stale comment
  lib/vsprintf.c: remove unused ip6_addr_string()
  common/log.c: use vscnprintf() in log_dispatch()

 common/log.c   |  2 +-
 lib/vsprintf.c | 28 ++++++----------------------
 2 files changed, 7 insertions(+), 23 deletions(-)


More information about the U-Boot mailing list