Skip to content

Commit 34c34d2

Browse files
committed
JsonConfig: fixes fractionNdigits will be incorrectly set to 0 when specifying null
1 parent 21b15ee commit 34c34d2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/options/display.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,12 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
376376
{
377377
if (yyjson_is_null(ndigits))
378378
options->fractionNdigits = -1;
379-
else if (!yyjson_is_int(ndigits))
380-
return "display.fraction.ndigits must be an integer";
381-
options->fractionNdigits = (int8_t) yyjson_get_int(ndigits);
379+
else
380+
{
381+
if (!yyjson_is_int(ndigits))
382+
return "display.fraction.ndigits must be an integer";
383+
options->fractionNdigits = (int8_t) yyjson_get_int(ndigits);
384+
}
382385
}
383386
yyjson_val* trailingZeros = yyjson_obj_get(val, "trailingZeros");
384387
if (trailingZeros)

0 commit comments

Comments
 (0)