diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2014-10-19 07:54:27 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2014-10-19 07:54:27 +0000 |
commit | 4c94fea93d22fec409fe5f6ae88869ca6575f510 (patch) | |
tree | 166d12b4f4831f114d046692dd712f7e96e40882 | |
parent | 264891ed223a087012710a377aa150d2885ae063 (diff) | |
download | flashrom-4c94fea93d22fec409fe5f6ae88869ca6575f510.tar.gz |
dmi.c: make sure we call isprint() correctly.
ISO C and POSIX require to call ctype functions with values representable
by unsigned char. We have used a char as input so far which might be
negative and hence get sign-extended.
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1852 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | dmi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -142,7 +142,7 @@ static char *dmi_string(const char *buf, uint8_t string_id, const char *limit) /* fix junk bytes in the string */ for (i = 0; i < len && buf[i] != '\0'; i++) { - if (isprint(buf[i])) + if (isprint((unsigned char)buf[i])) newbuf[i] = buf[i]; else newbuf[i] = ' '; |