diff options
| author | Rasmus Villemoes <[email protected]> | 2021-05-28 00:20:44 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-07-15 18:44:36 -0400 |
| commit | 97587786463ae3a44c95fcb053ab27136c646aa3 (patch) | |
| tree | 9d68cf2f6295b8150d951ace3926f8f669c4b36b /lib | |
| parent | 92f1e9a4b31c0bf0f4f61ab823a6a88657323646 (diff) | |
lib/vsprintf.c: implement printf() in terms of vprintf()
This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().
Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Rasmus Villemoes <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/vsprintf.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 9dc96c81c62..cf3982eb033 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -787,22 +787,11 @@ int printf(const char *fmt, ...) { va_list args; uint i; - char printbuffer[CONFIG_SYS_PBSIZE]; va_start(args, fmt); - - /* - * For this to work, printbuffer must be larger than - * anything we ever want to print. - */ - i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args); + i = vprintf(fmt, args); va_end(args); - /* Handle error */ - if (i <= 0) - return i; - /* Print the string */ - puts(printbuffer); return i; } |
