summaryrefslogtreecommitdiffstats
path: root/ext/json/ext/parser/unicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/ext/parser/unicode.c')
-rw-r--r--ext/json/ext/parser/unicode.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/json/ext/parser/unicode.c b/ext/json/ext/parser/unicode.c
index f19672735..a16ff262d 100644
--- a/ext/json/ext/parser/unicode.c
+++ b/ext/json/ext/parser/unicode.c
@@ -1,5 +1,3 @@
-/* vim: set cin et sw=4 ts=4: */
-
#include "unicode.h"
/*
@@ -105,12 +103,12 @@ char *JSON_convert_UTF16_to_UTF8 (
+ (ch2 - UNI_SUR_LOW_START) + halfBase;
++tmpPtr;
} else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- ruby_xfree(tmp);
+ free(tmp);
rb_raise(rb_path2class("JSON::ParserError"),
"source sequence is illegal/malformed near %s", source);
}
} else { /* We don't have the 16 bits following the high surrogate. */
- ruby_xfree(tmp);
+ free(tmp);
rb_raise(rb_path2class("JSON::ParserError"),
"partial character in source, but hit end near %s", source);
break;
@@ -118,7 +116,7 @@ char *JSON_convert_UTF16_to_UTF8 (
} else if (flags == strictConversion) {
/* UTF-16 surrogate values are illegal in UTF-32 */
if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- ruby_xfree(tmp);
+ free(tmp);
rb_raise(rb_path2class("JSON::ParserError"),
"source sequence is illegal/malformed near %s", source);
}
@@ -150,7 +148,7 @@ char *JSON_convert_UTF16_to_UTF8 (
}
rb_str_buf_cat(buffer, p, bytesToWrite);
}
- ruby_xfree(tmp);
+ free(tmp);
source += 5 + (n - 1) * 6;
return source;
}