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
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:
@@ -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");
|
||||
|
Reference in New Issue
Block a user