From 96c05490e946a9782210257a042b66246d821a65 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Thu, 6 Aug 2020 19:28:39 +0200 Subject: [PATCH] ompilation fixes --- include/n2n.h | 7 +++++++ src/edge_utils.c | 2 +- src/random_numbers.c | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/n2n.h b/include/n2n.h index 3e554db..ccabd0a 100644 --- a/include/n2n.h +++ b/include/n2n.h @@ -37,7 +37,12 @@ /* Moved here to define _CRT_SECURE_NO_WARNINGS before all the including takes place */ #ifdef WIN32 #include "win32/n2n_win32.h" + +#ifdef _MSC_VER +#include "config.h" /* Visual C++ */ +#else #include "win32/winconfig.h" +#endif #define N2N_CAN_NAME_IFACE 1 #undef N2N_HAVE_DAEMON #undef N2N_HAVE_SETUID @@ -47,6 +52,8 @@ #endif #endif + + #define PACKAGE_BUILDDATE (__DATE__ " " __TIME__) #include diff --git a/src/edge_utils.c b/src/edge_utils.c index 0ea4125..90ea8cb 100644 --- a/src/edge_utils.c +++ b/src/edge_utils.c @@ -1449,7 +1449,7 @@ void edge_send_packet2net(n2n_edge_t * eee, pkt.compression = N2N_COMPRESSION_ID_NONE; if(eee->conf.compression) { - uint8_t * compression_buffer; + uint8_t * compression_buffer = NULL; int32_t compression_len; switch (eee->conf.compression) { diff --git a/src/random_numbers.c b/src/random_numbers.c index ed734cc..aa98fb8 100644 --- a/src/random_numbers.c +++ b/src/random_numbers.c @@ -98,8 +98,8 @@ uint64_t n2n_rand () { state yet, a call to n2n_srand ( n2n_seed() ) would do. */ uint64_t n2n_seed (void) { - uint64_t seed; - uint64_t ret; + uint64_t seed = 0; + uint64_t ret = 0; size_t i; #ifdef SYS_getrandom