From 918067f117d5b9983a8f2273fd81983362a2ff88 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 15 Jul 2013 14:48:43 +0200 Subject: [PATCH] Fix warning "Both netname and configuration directory given" on Windows. --- src/names.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/names.c b/src/names.c index cc72a112..a631ad97 100644 --- a/src/names.c +++ b/src/names.c @@ -42,6 +42,9 @@ void make_names(void) { DWORD len = sizeof installdir; #endif + if(netname && confbase) + logger(DEBUG_ALWAYS, LOG_INFO, "Both netname and configuration directory given, using the latter..."); + if(netname) xasprintf(&identname, "tinc.%s", netname); else @@ -84,13 +87,10 @@ void make_names(void) { strcpy(unixsocketname + len, ".socket"); } - if(netname) { - if(!confbase) + if(!confbase) { + if(netname) xasprintf(&confbase, CONFDIR SLASH "tinc" SLASH "%s", netname); else - logger(DEBUG_ALWAYS, LOG_INFO, "Both netname and configuration directory given, using the latter..."); - } else { - if(!confbase) xasprintf(&confbase, CONFDIR SLASH "tinc"); } } -- 2.20.1