diff options
author | Petri Lehtinen <petri@digip.org> | 2009-10-27 17:46:57 +0200 |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2009-10-27 17:56:02 +0200 |
commit | f243930b6843295b81a4e4025497e40f19ff53ac (patch) | |
tree | e0264f44ed83067650f8bf5811c346cc164af0c2 /src | |
parent | 15d992cb6a6eeab8c2f4c7d00fa06a52fca62287 (diff) | |
download | jansson-f243930b6843295b81a4e4025497e40f19ff53ac.zip jansson-f243930b6843295b81a4e4025497e40f19ff53ac.tar.gz jansson-f243930b6843295b81a4e4025497e40f19ff53ac.tar.bz2 |
json_load_file: Initialize the error struct properly
Failing to do this has the effect that the error message is not
returned when the input file cannot be opened (e.g. if it doesn't
exist).
Thanks to Martin Vopatek for reporting.
Diffstat (limited to 'src')
-rw-r--r-- | src/load.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -864,6 +864,8 @@ json_t *json_load_file(const char *path, json_error_t *error) json_t *result; FILE *fp; + error_init(error); + fp = fopen(path, "r"); if(!fp) { |