X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;h=cac7455d3a16f44add273ac4d41d2cc53963e0f8;hp=13719f52fbdf307581ef202c2638bbdc7b8269f5;hb=dff4955ddec1d318a56997388f367186c5b8078c;hpb=2116c6eb7d328c7aa3ce3da54f95367e5199d373 diff --git a/src/net_setup.c b/src/net_setup.c index 13719f52..cac7455d 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -388,8 +388,8 @@ static bool setup_myself(void) { char *address = NULL; char *proxy = NULL; char *space; - char *envp[5] = {}; - struct addrinfo *ai, *aip, hint = {}; + char *envp[5] = {0}; + struct addrinfo *ai, *aip, hint = {0}; bool choice; int i, err; int replaywin_int; @@ -852,9 +852,9 @@ static bool setup_myself(void) { } /* Run tinc-up script to further initialize the tap interface */ - xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); - xasprintf(&envp[1], "DEVICE=%s", device ? : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); + xasprintf(&envp[0], "NETNAME=%s", netname ? netname : ""); + xasprintf(&envp[1], "DEVICE=%s", device ? device : ""); + xasprintf(&envp[2], "INTERFACE=%s", iface ? iface : ""); xasprintf(&envp[3], "NAME=%s", myself->name); #ifdef HAVE_MINGW @@ -1068,7 +1068,7 @@ bool setup_network(void) { void close_network_connections(void) { avl_node_t *node, *next; connection_t *c; - char *envp[5] = {}; + char *envp[5] = {0}; int i; for(node = connection_tree->head; node; node = next) { @@ -1099,9 +1099,9 @@ void close_network_connections(void) { close(listen_socket[i].udp); } - xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); - xasprintf(&envp[1], "DEVICE=%s", device ? : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); + xasprintf(&envp[0], "NETNAME=%s", netname ? netname : ""); + xasprintf(&envp[1], "DEVICE=%s", device ? device : ""); + xasprintf(&envp[2], "INTERFACE=%s", iface ? iface : ""); xasprintf(&envp[3], "NAME=%s", myself->name); exit_requests();