summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-08 05:00:02 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-08 05:00:02 +0000
commitce573f3166d8b80d6a0b9c6c027b0c5e10f05c4b (patch)
treea20522e4dbebbd97bc826ef7def2f97cf6011c69 /ext/json
parent279c7bdd884e5e158d3599750fe4d10177132296 (diff)
* ext/json/generator/generator.c (isArrayOrObject): cast char to
unsigned char. [Bug #8378] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/generator/generator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index 42a1658..7bc1934 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 == '}');
}