-
Notifications
You must be signed in to change notification settings - Fork 291
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
A wrong read error is given when a JSON string is terminated at a specific place. For example:
{"duck": 42.
Will give a YYJSON_READ_ERROR_INVALID_NUMBER
. However, it should be YYJSON_READ_ERROR_UNEXPECTED_END
.
Your environment
- OS: macOS Ventura 13.0
- Compiler: Apple clang 14
Additional context
I've implemented a streaming read in DuckDB using yyjson, and we read a file block-by-block. The block boundaries are arbitrary, so this happened while running a test.
I've changed occurrences of return_err(cur - 1, INVALID_NUMBER, msg);
in yyjson.cpp
to return_err(cur, INVALID_NUMBER, msg);
, which seems to solve the problem.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working