projects
/
profile
/
ivi
/
jansson.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Fix some memory leaks and invalid memory references
[profile/ivi/jansson.git]
/
test
/
load_dump.c
1
#include <stdio.h>
2
#include <jansson.h>
3
4
int main(int argc, char *argv[])
5
{
6
json_t *json;
7
json_error_t error;
8
9
if(argc != 3) {
10
fprintf(stderr, "usage: %s infile outfile\n", argv[0]);
11
return 2;
12
}
13
14
json = json_load(argv[1], &error);
15
if(!json) {
16
fprintf(stderr, "%d\n%s\n", error.line, error.text);
17
return 1;
18
}
19
20
json_dump(json, argv[2], 0);
21
json_decref(json);
22
23
return 0;
24
}