From 28e32902c3e5e1a453f33087a35de63f86435f1c Mon Sep 17 00:00:00 2001 From: Antares Date: Sun, 31 Mar 2024 00:27:19 +0800 Subject: [PATCH] fix: Fix error in decoding --- src/pycJSON_decode.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pycJSON_decode.c b/src/pycJSON_decode.c index a2f5d1a..b5a6d90 100644 --- a/src/pycJSON_decode.c +++ b/src/pycJSON_decode.c @@ -319,10 +319,7 @@ static bool parse_string(PyObject **item, parse_buffer *const input_buffer) { /* zero terminate the output */ *output_pointer = '\0'; - if (fixed_utf8_len == -1 || fixed_utf8_len == 3) - *item = PyUnicode_FromString((char *) output); - else - *item = PyUnicode_FromKindAndData(fixed_utf8_len, output, output_pointer - output); + *item = PyUnicode_FromString((char *) output); if (output != output_buffer) input_buffer->hooks.deallocate(output);