Rearrange the json_tokener_state_escape_unicode case in json_tokener to simplify the code slightly and make it a bit easier to understand.

While here, drop the utf8_replacement_char that is unnecesarily added if we run out of input in the middle of a unicode escape.  No other functional changes (yet).
This commit is contained in:
Eric Haszlakiewicz
2020-06-21 03:10:55 +00:00
parent 50179fb09f
commit 36118b681e
2 changed files with 172 additions and 165 deletions

View File

@@ -111,7 +111,7 @@ struct json_tokener
* @deprecated See json_tokener_get_error() instead.
*/
enum json_tokener_error err;
unsigned int ucs_char, got_hi_surrogate;
unsigned int ucs_char, high_surrogate;
char quote_char;
struct json_tokener_srec *stack;
int flags;