From d772e1e7feb3d782564fe7f46374d4ae8a5f4c36 Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Fri, 25 Apr 2008 23:10:23 +0000 Subject: [PATCH] libpayload: Fix a small but aggressive bug in printf() This was causing the returned counter value to be one more then it should be when printing a single character. Signed-off-by: Jordan Crouse Acked-by: Ward Vandewege git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3271 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/libc/printf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payloads/libpayload/libc/printf.c b/payloads/libpayload/libc/printf.c index 2f1ca8bda..6972636b2 100644 --- a/payloads/libpayload/libc/printf.c +++ b/payloads/libpayload/libc/printf.c @@ -156,7 +156,7 @@ static int print_char(char c, int width, uint64_t flags, struct printf_spec *ps) ++counter; } - return ++counter; + return counter; } /** -- 2.25.1