diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2014-10-19 07:54:27 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2014-10-19 07:54:27 +0000 |
commit | 4758d07621676502ca3b137bc66b66ee3d24347b (patch) | |
tree | 166d12b4f4831f114d046692dd712f7e96e40882 | |
parent | 08d0c5516040b1f54b767a4ab5db3ea853b7754d (diff) | |
download | flashrom-4758d07621676502ca3b137bc66b66ee3d24347b.zip flashrom-4758d07621676502ca3b137bc66b66ee3d24347b.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.
Corresponding to flashrom svn r1852.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
-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] = ' '; |