Fix node name check for "connect" and "disconnect" commands.
authorGuus Sliepen <guus@tinc-vpn.org>
Thu, 30 Aug 2012 12:00:34 +0000 (14:00 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 30 Aug 2012 12:00:34 +0000 (14:00 +0200)
src/tincctl.c

index fa52533..00d8eb9 100644 (file)
@@ -928,7 +928,7 @@ static int cmd_connect(int argc, char *argv[]) {
                return 1;
        }
 
-       if(!check_id(argv[2])) {
+       if(!check_id(argv[1])) {
                fprintf(stderr, "Invalid name for node.\n");
                return 1;
        }
@@ -951,7 +951,7 @@ static int cmd_disconnect(int argc, char *argv[]) {
                return 1;
        }
 
-       if(!check_id(argv[2])) {
+       if(!check_id(argv[1])) {
                fprintf(stderr, "Invalid name for node.\n");
                return 1;
        }