From 4891d8de22ee41b4318025fd7779167509713a49 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Sun, 16 Dec 2012 20:20:48 +0000 Subject: [PATCH] Pass an unsigned char to ctype functions. It must be EOF or representable as an unsigned char, otherwise the result is undefined. Particularly, if char has the same range as signed char, in which case, it maps negative char values (quite normal outside 7-bit ASCII) to positive unsigned char values. --- meta_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta_info.c b/meta_info.c index b2c81d2..567859e 100644 --- a/meta_info.c +++ b/meta_info.c @@ -258,8 +258,8 @@ mi_extract(const char *filename) void str_sanitize(char *s) { - size_t i; - char c; + size_t i; + unsigned char c; for (i = 0; i < strlen(s); i++) { c = s[i];