From: Guus Sliepen <guus@tinc-vpn.org>
Date: Mon, 14 Jan 2013 11:59:17 +0000 (+0100)
Subject: Don't complain about garbage if we skipped importing a host file.
X-Git-Tag: release-1.1pre5~15
X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=cad86108f3a47e9bba885ccd8decf20057f909f7;p=tinc

Don't complain about garbage if we skipped importing a host file.
---

diff --git a/src/tincctl.c b/src/tincctl.c
index dd0bbcc2..3b006605 100644
--- a/src/tincctl.c
+++ b/src/tincctl.c
@@ -1857,6 +1857,8 @@ static int cmd_import(int argc, char *argv[]) {
 
 	while(fgets(buf, sizeof buf, in)) {
 		if(sscanf(buf, "Name = %s", name) == 1) {
+			firstline = false;
+
 			if(!check_id(name)) {
 				fprintf(stderr, "Invalid Name in input!\n");
 				return 1;
@@ -1881,7 +1883,6 @@ static int cmd_import(int argc, char *argv[]) {
 			}
 
 			count++;
-			firstline = false;
 			continue;
 		} else if(firstline) {
 			fprintf(stderr, "Junk at the beginning of the input, ignoring.\n");