From: Guus Sliepen Date: Mon, 27 Jan 2014 22:21:25 +0000 (+0100) Subject: Add missing newlines when copying variables from tinc.conf to an invitation file. X-Git-Tag: release-1.1pre10~10 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=00398a60ec317740bcec83c5a524c5a95ce7f1c2;p=oweals%2Ftinc.git Add missing newlines when copying variables from tinc.conf to an invitation file. --- diff --git a/src/invitation.c b/src/invitation.c index 59bcf45..a94460e 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -404,8 +404,12 @@ int cmd_invite(int argc, char *argv[]) { char buf[1024]; while(fgets(buf, sizeof buf, tc)) { if((!strncasecmp(buf, "Mode", 4) && strchr(" \t=", buf[4])) - || (!strncasecmp(buf, "Broadcast", 9) && strchr(" \t=", buf[9]))) + || (!strncasecmp(buf, "Broadcast", 9) && strchr(" \t=", buf[9]))) { fputs(buf, f); + // Make sure there is a newline character. + if(!strchr(buf, '\n')) + fputc('\n', f); + } } fclose(tc); }