diff options
author | Rob Landley <rob@landley.net> | 2015-09-11 16:35:14 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-09-11 16:35:14 -0500 |
commit | e5354ca12a232b3f97726214254a868771cb70d1 (patch) | |
tree | ba373c24ede64b8a18f11a02cf834ce99aa586bf /toys/other/netcat.c | |
parent | d067571abb2b7934f3350c90ca891beb987c68fd (diff) | |
download | toybox-e5354ca12a232b3f97726214254a868771cb70d1.tar.gz |
Replace toys.exithelp with help_exit() in lib.
Diffstat (limited to 'toys/other/netcat.c')
-rw-r--r-- | toys/other/netcat.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/toys/other/netcat.c b/toys/other/netcat.c index 9d0c3cf3..3cc3f0a0 100644 --- a/toys/other/netcat.c +++ b/toys/other/netcat.c @@ -91,11 +91,9 @@ void netcat_main(void) // The argument parsing logic can't make "<2" conditional on other // arguments like -f and -l, so we do it by hand here. - if (toys.optflags&FLAG_f) { - if (toys.optc) toys.exithelp++; - } else if (!(toys.optflags&(FLAG_l|FLAG_L)) && toys.optc!=2) toys.exithelp++; - - if (toys.exithelp) error_exit("Argument count wrong"); + if ((toys.optflags&FLAG_f) ? toys.optc : + (!(toys.optflags&(FLAG_l|FLAG_L)) && toys.optc!=2)) + help_exit("Argument count wrong"); if (TT.filename) pollfds[0].fd = xopen(TT.filename, O_RDWR); else { |