mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-03 00:45:41 +02:00
Preserve the original string representation of numbers too.
Not always useful, but sometimes it will be.
This commit is contained in:
+5
-2
@@ -414,8 +414,11 @@ again:
|
||||
json_object *n = add_object(j, JSON_NUMBER);
|
||||
if (n != NULL) {
|
||||
n->number = atof(val.buf);
|
||||
n->string = val.buf;
|
||||
n->length = val.n;
|
||||
} else {
|
||||
string_free(&val);
|
||||
}
|
||||
string_free(&val);
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -542,7 +545,7 @@ void json_free(json_object *o) {
|
||||
|
||||
free(k);
|
||||
free(v);
|
||||
} else if (o->type == JSON_STRING) {
|
||||
} else if (o->type == JSON_STRING || o->type == JSON_NUMBER) {
|
||||
free(o->string);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user