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:
parent
10ae1a84d0
commit
37077bfe36
1 changed files with 4 additions and 1 deletions
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue