X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ffsck.c;h=e7262727e67e85e5a328a65a65fcf034febe6bf1;hb=373b0c12d9d0e8a3b449fd18be704e28dd6403e1;hp=3a64959de5a83bace6dc3163418013c6b0e40409;hpb=28b7a53b693f6b4e70218a926e68a36ece54cda1;p=tinc diff --git a/src/fsck.c b/src/fsck.c index 3a64959d..e7262727 100644 --- a/src/fsck.c +++ b/src/fsck.c @@ -141,8 +141,9 @@ static void check_conffile(const char *nodename, bool server) { ++total_vars; } - int count[total_vars]; - memset(count, 0, sizeof(count)); + const size_t countlen = total_vars * sizeof(int); + int *count = alloca(countlen); + memset(count, 0, countlen); for splay_each(config_t, conf, &config) { int var_type = 0; @@ -184,7 +185,7 @@ static void check_conffile(const char *nodename, bool server) { splay_empty_tree(&config); } -#ifdef HAVE_MINGW +#ifdef HAVE_WINDOWS typedef int uid_t; static uid_t getuid(void) { @@ -218,7 +219,7 @@ static void check_key_file_mode(const char *fname) { } } } -#endif // HAVE_MINGW +#endif // HAVE_WINDOWS static char *read_node_name(void) { if(access(tinc_conf, R_OK) == 0) {