X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Finvitation.c;h=550fb5de2b089719812e90520e6bf0cdaac330ad;hb=160b7cb5e3e9b7869f6ca38e6a7ab2db39aba979;hp=f1cde581584ea80227f3212a3edad251997fae0b;hpb=81c71203201f6642a496f466660236efdd522ceb;p=tinc diff --git a/src/invitation.c b/src/invitation.c index f1cde581..550fb5de 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -32,12 +32,6 @@ #include "utils.h" #include "xalloc.h" -#ifdef HAVE_MINGW -#define SCRIPTEXTENSION ".bat" -#else -#define SCRIPTEXTENSION "" -#endif - int addressfamily = AF_UNSPEC; char *get_my_hostname() { @@ -362,6 +356,9 @@ int cmd_invite(int argc, char *argv[]) { if(!f) abort(); + // Get the local address + char *address = get_my_hostname(); + // Fill in the details. fprintf(f, "Name = %s\n", argv[1]); if(netname) @@ -376,7 +373,6 @@ int cmd_invite(int argc, char *argv[]) { fclose(f); // Create an URL from the local address, key hash and cookie - char *address = get_my_hostname(); printf("%s/%s%s\n", address, hash, cookie); free(filename); free(address);