[前][次][番号順一覧][スレッド一覧]

ruby-changes:28557

From: naruse <ko1@a...>
Date: Wed, 8 May 2013 14:00:17 +0900 (JST)
Subject: [ruby-changes:28557] naruse:r40609 (trunk): * ext/json/generator/generator.c (isArrayOrObject): cast char to

naruse	2013-05-08 14:00:02 +0900 (Wed, 08 May 2013)

  New Revision: 40609

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40609

  Log:
    * ext/json/generator/generator.c (isArrayOrObject): cast char to
      unsigned char. [Bug #8378]

  Modified files:
    trunk/ChangeLog
    trunk/ext/json/generator/generator.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40608)
+++ ChangeLog	(revision 40609)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May  8 13:49:38 2013  NARUSE, Yui  <naruse@r...>
+
+	* ext/json/generator/generator.c (isArrayOrObject): cast char to
+	  unsigned char. [Bug #8378]
+
 Wed May  8 13:46:10 2013  NARUSE, Yui  <naruse@r...>
 
 	* ext/json/generator/depend: fix dependencies [Bug #8379]
Index: ext/json/generator/generator.c
===================================================================
--- ext/json/generator/generator.c	(revision 40608)
+++ ext/json/generator/generator.c	(revision 40609)
@@ -894,8 +894,8 @@ static int isArrayOrObject(VALUE string) https://github.com/ruby/ruby/blob/trunk/ext/json/generator/generator.c#L894
     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 == '}');
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]