aboutsummaryrefslogtreecommitdiff
path: root/src/load.c
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2017-12-20 18:27:04 +0100
committerPhilipp Stephani <phst@google.com>2017-12-20 18:27:04 +0100
commit45228cada4c379fc1a290b1a0866f51e24396b47 (patch)
tree412bc473764978723841a320bdb4db2b59688e74 /src/load.c
parent9e5af7c3b77f81a7d1720073dca600e51fe9962d (diff)
downloadjansson-45228cada4c379fc1a290b1a0866f51e24396b47.zip
jansson-45228cada4c379fc1a290b1a0866f51e24396b47.tar.gz
jansson-45228cada4c379fc1a290b1a0866f51e24396b47.tar.bz2
Use a more specific error code for premature end of input
Diffstat (limited to 'src/load.c')
-rw-r--r--src/load.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/load.c b/src/load.c
index 339adfa..deb36f3 100644
--- a/src/load.c
+++ b/src/load.c
@@ -122,6 +122,10 @@ static void error_set(json_error_t *error, const lex_t *lex,
}
else
{
+ if(code == json_error_invalid_syntax) {
+ /* More specific error code for premature end of file. */
+ code = json_error_premature_end_of_input;
+ }
if(lex->stream.state == STREAM_STATE_ERROR) {
/* No context for UTF-8 decoding errors */
result = msg_text;