diff --git a/ChangeLog b/ChangeLog index bdcdbd25c1..bc95812ae8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed May 8 13:49:38 2013 NARUSE, Yui + + * ext/json/generator/generator.c (isArrayOrObject): cast char to + unsigned char. [Bug #8378] + Wed May 8 13:46:10 2013 NARUSE, Yui * ext/json/generator/depend: fix dependencies [Bug #8379] diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c index 42a1658811..7bc193455d 100644 --- a/ext/json/generator/generator.c +++ b/ext/json/generator/generator.c @@ -894,8 +894,8 @@ static int isArrayOrObject(VALUE string) long string_len = RSTRING_LEN(string); char *p = RSTRING_PTR(string), *q = p + string_len - 1; if (string_len < 2) return 0; - for (; p < q && isspace(*p); p++); - for (; q > p && isspace(*q); q--); + for (; p < q && isspace((unsigned char)*p); p++); + for (; q > p && isspace((unsigned char)*q); q--); return (*p == '[' && *q == ']') || (*p == '{' && *q == '}'); }