From f5fc43fe735ca6df0f39c31c613951b5638fa6bc Mon Sep 17 00:00:00 2001 From: lemoer Date: Mon, 25 Jul 2016 14:29:04 +0200 Subject: [PATCH] gluon-neighbour-info: improve verbosity on wrong cli parameters (2/2) We do not want to introduce a new variable to check whether destination is set correctly. --- package/gluon-neighbour-info/src/gluon-neighbour-info.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index b7206f6f..808a1b12 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -153,7 +153,6 @@ int main(int argc, char **argv) { char *sse = NULL; bool loop = false; int ret = false; - bool destination_set = false; int c; while ((c = getopt(argc, argv, "p:d:r:i:t:s:c:lh")) != -1) @@ -165,8 +164,6 @@ int main(int argc, char **argv) { if (!inet_pton(AF_INET6, optarg, &client_addr.sin6_addr)) { perror("Invalid IPv6 address. This message will probably confuse you"); exit(EXIT_FAILURE); - } else { - destination_set = true; } break; case 'i': @@ -217,7 +214,7 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - if (!destination_set) { + if (IN6_IS_ADDR_UNSPECIFIED(&client_addr.sin6_addr)) { fprintf(stderr, "No destination address supplied\n"); exit(EXIT_FAILURE); }