[coreboot] [patch 4/4] libpayload: Fix a small but aggressive bug in printf()

Peter Stuge peter at stuge.se
Fri Apr 25 20:57:19 CEST 2008


On Fri, Apr 25, 2008 at 09:52:13AM -0600, jordan.crouse at amd.com wrote:
> 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 at amd.com>
> Index: libpayload/libc/printf.c
> ===================================================================
> --- libpayload.orig/libc/printf.c	2008-04-24 11:44:17.000000000 -0600
> +++ libpayload/libc/printf.c	2008-04-24 11:45:40.000000000 -0600
> @@ -156,7 +156,7 @@
>  			++counter;
>  	}
>  
> -	return ++counter;
> +	return counter;

What about the cases when printf() does not print more than one
character? Does the simple fix cover all cases?


//Peter




More information about the coreboot mailing list