diff options
author | Peter Stuge <peter@stuge.se> | 2009-03-19 13:34:53 +0000 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2009-03-19 13:34:53 +0000 |
commit | 37077bfe36842f897752998c94f1587dba43a7ce (patch) | |
tree | 4867d81779b615cd88912b29955c663217cae078 | |
parent | 10ae1a84d0e83a6af8629a1e54d597931591ae67 (diff) | |
download | coreboot-37077bfe36842f897752998c94f1587dba43a7ce.tar.gz coreboot-37077bfe36842f897752998c94f1587dba43a7ce.tar.bz2 coreboot-37077bfe36842f897752998c94f1587dba43a7ce.zip |
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
-rw-r--r-- | lib/vtxprintf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/vtxprintf.c b/lib/vtxprintf.c index bc3621b91b0d..8a95ca1ec410 100644 --- a/lib/vtxprintf.c +++ b/lib/vtxprintf.c @@ -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++; |