aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2009-10-27 17:46:57 +0200
committerPetri Lehtinen <petri@digip.org>2009-10-27 17:56:02 +0200
commitf243930b6843295b81a4e4025497e40f19ff53ac (patch)
treee0264f44ed83067650f8bf5811c346cc164af0c2 /src
parent15d992cb6a6eeab8c2f4c7d00fa06a52fca62287 (diff)
downloadjansson-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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/load.c b/src/load.c
index f004525..53241ff 100644
--- a/src/load.c
+++ b/src/load.c
@@ -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)
{