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 <[email protected]>
Acked-by: Peter Stuge <[email protected]>


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++;


-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to