simplify calculation: the low surrogate range is already checked - json2tsv - JSON to TSV converter
(HTM) git clone git://git.codemadness.org/json2tsv
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 058bab370580f79697a492b58a8547a5deae6e64
(DIR) parent 933582372d81a911193fb1da7c86b6b960432535
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 13 Oct 2019 21:40:11 +0200
simplify calculation: the low surrogate range is already checked
Diffstat:
M json2tsv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/json2tsv.c b/json2tsv.c
@@ -185,7 +185,7 @@ parsejson(void (*cb)(struct json_node *, size_t, const char *), const char **err
*errstr = "invalid codepoint";
goto end;
}
- cp = (hi << 10) + (0xDC00 + (lo & 0x3FF)) - 56613888;
+ cp = (hi << 10) + lo - 56613888; /* - offset */
}
if (capacity(&value, &vz, v, 5) == -1)
goto end;