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 <[email protected]> Acked-by: Stefan Tauner <[email protected]> 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] = ' '; _______________________________________________ flashrom mailing list [email protected] http://www.flashrom.org/mailman/listinfo/flashrom
