libpayload: Fix a small but aggressive bug in printf()
authorJordan Crouse <jordan.crouse@amd.com>
Fri, 25 Apr 2008 23:10:23 +0000 (23:10 +0000)
committerJordan Crouse <jordan.crouse@amd.com>
Fri, 25 Apr 2008 23:10:23 +0000 (23:10 +0000)
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 <jordan.crouse@amd.com>
Acked-by: Ward Vandewege <ward@gnu.org>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3271 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

payloads/libpayload/libc/printf.c

index 2f1ca8bda6b31bc24c1b4f9c7a3b4487f9e1a198..6972636b2365a4c817ce516b6840f57cc18e8e94 100644 (file)
@@ -156,7 +156,7 @@ static int print_char(char c, int width, uint64_t flags, struct printf_spec *ps)
                        ++counter;
        }
 
-       return ++counter;
+       return counter;
 }
 
 /**