From 9c6a8fd84ff7dddf01d5e1b33a6a6d935816795b Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Fri, 11 Jan 2013 13:44:56 +0100 Subject: Fixed a bug requiring -t to be used before -l --- mactelnet.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mactelnet.c b/mactelnet.c index 0006f07..51d9df1 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -69,6 +69,7 @@ static struct in_addr destip; static int sourceport; static int connect_timeout = CONNECT_TIMEOUT; +static char run_mndp = 0; static int mndp_timeout = 0; static int is_a_tty = 1; @@ -485,7 +486,7 @@ int main (int argc, char **argv) { break; case 'l': - return mndp(mndp_timeout); + run_mndp = 1; break; case 'h': @@ -495,6 +496,9 @@ int main (int argc, char **argv) { } } + if (run_mndp) { + return mndp(mndp_timeout); + } if (argc - optind < 1 || print_help) { print_version(); fprintf(stderr, _("Usage: %s [-h] [-n] [-t ] [-u ] [-p ] [-U ] | -l\n"), argv[0]); -- cgit v1.2.3