Author: stefanct Date: Sun Oct 19 09:54:27 2014 New Revision: 1852 URL: http://flashrom.org/trac/flashrom/changeset/1852
Log: 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
Modified: trunk/dmi.c
Modified: trunk/dmi.c ============================================================================== --- trunk/dmi.c Sun Oct 19 09:53:45 2014 (r1851) +++ trunk/dmi.c Sun Oct 19 09:54:27 2014 (r1852) @@ -142,7 +142,7 @@
/* 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] = ' ';