[flashrom] [commit] r1852 - trunk

repository service svn at flashrom.org
Sun Oct 19 09:54:28 CEST 2014


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 at student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner at 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] = ' ';




More information about the flashrom mailing list