mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 10:25:41 +02:00
Be consistent about EOF handling around whitespace
This commit is contained in:
+4
-9
@@ -106,6 +106,9 @@ json_object *json_parse(FILE *f, json_object *current, char **error) {
|
|||||||
int current_is = 0;
|
int current_is = 0;
|
||||||
int c;
|
int c;
|
||||||
again:
|
again:
|
||||||
|
/////////////////////////// Whitespace
|
||||||
|
|
||||||
|
do {
|
||||||
c = getc(f);
|
c = getc(f);
|
||||||
if (c == EOF) {
|
if (c == EOF) {
|
||||||
if (current != NULL) {
|
if (current != NULL) {
|
||||||
@@ -115,15 +118,7 @@ again:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} while (c == ' ' || c == '\t' || c == '\r' || c == '\n');
|
||||||
/////////////////////////// Whitespace
|
|
||||||
|
|
||||||
while (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
|
|
||||||
c = getc(f);
|
|
||||||
if (c == EOF) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////// Arrays
|
/////////////////////////// Arrays
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user