From ff9e6c32c37e685f25e5ba09611e6e7d1a556bd8 Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Sun, 19 Oct 2014 07:54:27 +0000 Subject: 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 Acked-by: Stefan Tauner --- dmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmi.c b/dmi.c index a7a9a61..832d7ab 100644 --- a/dmi.c +++ b/dmi.c @@ -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] = ' '; -- cgit v1.1