Fix build on FreeBSD
Some checks failed
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=OFF (push) Failing after 10s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=OFF (push) Failing after 11s
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=ON (push) Failing after 14s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=ON (push) Failing after 15s
CMake / ubuntu-latest - shared=OFF, pthread=ON, posix=ON (push) Failing after 15s
CMake / ubuntu-latest - shared=ON, pthread=ON, posix=ON (push) Has been cancelled

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-08-09 08:34:14 +03:00
parent 055f0bc2f5
commit 8c1694d3d9
3 changed files with 9 additions and 4 deletions

View File

@@ -1,6 +1,5 @@
#include <dcfg.h>
#include <alloca.h>
#include <getopt.h>
#include <inttypes.h>
#include <stdio.h>
@@ -105,7 +104,7 @@ void walk_value(dcfg_Value *value, bool evaluate, int indent, bool first)
size_t n = 0;
dcfg_Value_get_object_keys(value, 0, &n, NULL);
dcfg_StringView *keys
= n ? (dcfg_StringView *)alloca(n * sizeof(*keys)) : NULL;
= n ? (dcfg_StringView *)calloc(1, n * sizeof(*keys)) : NULL;
dcfg_Value_get_object_keys(value, n, &n, keys);
printf("{\n");