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@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@1159 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Peter Stuge 2009-03-19 13:34:53 +00:00
commit 37077bfe36

View file

@ -202,8 +202,11 @@ int vtxprintf(void (*tx_byte)(unsigned char byte, void *arg), void *arg, const c
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++;