[coreboot] r1159 - coreboot-v3/lib

svn at coreboot.org svn at coreboot.org
Thu Mar 19 14:34:54 CET 2009


Author: stuge
Date: 2009-03-19 14:34:53 +0100 (Thu, 19 Mar 2009)
New Revision: 1159

Modified:
   coreboot-v3/lib/vtxprintf.c
Log:
v3 vtxprintf(): Stop looking for non-ASCII characters after one has been found.

And update the string length. Many thanks to Mathias Krause for spotting this!

Signed-off-by: Peter Stuge <peter at stuge.se>
Acked-by: Peter Stuge <peter at stuge.se>


Modified: coreboot-v3/lib/vtxprintf.c
===================================================================
--- coreboot-v3/lib/vtxprintf.c	2009-03-19 12:53:57 UTC (rev 1158)
+++ coreboot-v3/lib/vtxprintf.c	2009-03-19 13:34:53 UTC (rev 1159)
@@ -202,8 +202,11 @@
 			len = strnlen(s, precision);
 
 			for (i = 0; i < len; ++i)
-				if (!isprint(*s[i]))
+				if (!isprint(*s[i])) {
 					s = "<non-ASCII characters>";
+					len = strlen(s);
+					break;
+				}
 			if (!(flags & LEFT))
 				while (len < field_width--)
 					tx_byte(' ', arg), count++;





More information about the coreboot mailing list