Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
fix: Fix error in decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Antares0982 committed Mar 30, 2024
1 parent ea326ae commit 28e3290
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/pycJSON_decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 28e3290

Please sign in to comment.