summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/json/ext/parser/parser.c2
-rw-r--r--ext/json/ext/parser/parser.rl2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c
index c572a95..d4adb8e 100644
--- a/ext/json/ext/parser/parser.c
+++ b/ext/json/ext/parser/parser.c
@@ -1305,6 +1305,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
{
char *p = string, *pe = string, *unescape;
int unescape_len;
+ char buf[4];
while (pe < stringEnd) {
if (*pe == '\\') {
@@ -1337,7 +1338,6 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
if (pe > stringEnd - 4) {
return Qnil;
} else {
- char buf[4];
UTF32 ch = unescape_unicode((unsigned char *) ++pe);
pe += 3;
if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl
index 5838dac..c96b0a8 100644
--- a/ext/json/ext/parser/parser.rl
+++ b/ext/json/ext/parser/parser.rl
@@ -405,6 +405,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
{
char *p = string, *pe = string, *unescape;
int unescape_len;
+ char buf[4];
while (pe < stringEnd) {
if (*pe == '\\') {
@@ -437,7 +438,6 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
if (pe > stringEnd - 4) {
return Qnil;
} else {
- char buf[4];
UTF32 ch = unescape_unicode((unsigned char *) ++pe);
pe += 3;
if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {