Make json_error_t transparent again

After looking at the new code for a few days, I didn't like it
anymore. To prepare for the future, a few fields will be added to the
json_error_t struct later.

This reverts commit 23dd078c8d. Some
adjustments were needed because of newer commits.
This commit is contained in:
Petri Lehtinen
2010-10-26 21:05:40 +03:00
parent 198d537be7
commit bb5d4efb2e
8 changed files with 110 additions and 156 deletions

View File

@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
size_t flags = 0;
json_t *json;
json_error_t *error;
json_error_t error;
if(argc != 1) {
fprintf(stderr, "usage: %s\n", argv[0]);
@@ -61,10 +61,7 @@ int main(int argc, char *argv[])
json = json_loadf(stdin, 0, &error);
if(!json) {
fprintf(stderr, "%d\n%s\n",
json_error_line(error),
json_error_msg(error));
free(error);
fprintf(stderr, "%d\n%s\n", error.line, error.text);
return 1;
}