mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Forgot to initialize the error to NULL
This commit is contained in:
parent
a74444af28
commit
9d4ee102b4
16
jsonpull.c
16
jsonpull.c
@ -9,6 +9,14 @@ typedef enum json_expect {
|
|||||||
JSON_ITEM, JSON_COMMA, JSON_COLON, JSON_KEY, JSON_VALUE,
|
JSON_ITEM, JSON_COMMA, JSON_COLON, JSON_KEY, JSON_VALUE,
|
||||||
} json_expect;
|
} json_expect;
|
||||||
|
|
||||||
|
static json_pull *json_init() {
|
||||||
|
json_pull *j = malloc(sizeof(json_pull));
|
||||||
|
j->container = NULL;
|
||||||
|
j->error = NULL;
|
||||||
|
j->line = 1;
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
|
||||||
static int read_file(json_pull *j) {
|
static int read_file(json_pull *j) {
|
||||||
int c = fgetc(j->source);
|
int c = fgetc(j->source);
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
@ -24,9 +32,7 @@ static int peek_file(json_pull *j) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
json_pull *json_begin_file(FILE *f) {
|
json_pull *json_begin_file(FILE *f) {
|
||||||
json_pull *j = malloc(sizeof(json_pull));
|
json_pull *j = json_init();
|
||||||
j->container = NULL;
|
|
||||||
j->line = 1;
|
|
||||||
|
|
||||||
j->read = read_file;
|
j->read = read_file;
|
||||||
j->peek = peek_file;
|
j->peek = peek_file;
|
||||||
@ -58,9 +64,7 @@ static int peek_string(json_pull *p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
json_pull *json_begin_string(char *s) {
|
json_pull *json_begin_string(char *s) {
|
||||||
json_pull *j = malloc(sizeof(json_pull));
|
json_pull *j = json_init();
|
||||||
j->container = NULL;
|
|
||||||
j->line = 1;
|
|
||||||
|
|
||||||
j->read = read_string;
|
j->read = read_string;
|
||||||
j->peek = peek_string;
|
j->peek = peek_string;
|
||||||
|
Loading…
Reference in New Issue
Block a user