summaryrefslogtreecommitdiff
path: root/ext/json/utf8_to_utf16.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2008-01-30 03:17:57 +0000
committerStanislav Malyshev <stas@php.net>2008-01-30 03:17:57 +0000
commitb4443f35fff7c2b094f4ec6767f3838a4d7b5a7e (patch)
tree92f46120124ca94b142602854b4e03bf5011ca12 /ext/json/utf8_to_utf16.c
parent6a455ee097c45cbc35cfe38139eaade040b9082a (diff)
downloadphp-git-b4443f35fff7c2b094f4ec6767f3838a4d7b5a7e.tar.gz
fix #43941: invalid utf-8 not accepted
Diffstat (limited to 'ext/json/utf8_to_utf16.c')
-rw-r--r--ext/json/utf8_to_utf16.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/utf8_to_utf16.c b/ext/json/utf8_to_utf16.c
index bc2d6f36d6..42ea9e5d8e 100644
--- a/ext/json/utf8_to_utf16.c
+++ b/ext/json/utf8_to_utf16.c
@@ -40,7 +40,7 @@ utf8_to_utf16(unsigned short w[], char p[], int length)
for (;;) {
c = utf8_decode_next(&utf8);
if (c < 0) {
- return UTF8_END ? the_index : UTF8_ERROR;
+ return (c == UTF8_END) ? the_index : UTF8_ERROR;
}
if (c < 0x10000) {
w[the_index] = (unsigned short)c;