aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2008-12-08 00:16:07 -0600
committerRob Landley <rob@landley.net>2008-12-08 00:16:07 -0600
commitdcb52f7c9a01a0609a7d4f00256f6807ae49320b (patch)
treed7d72b9840881fbee3d0f4173d419953ef3994ba
parent5f612e7749d9121433b9b7404c8e12c2fabd6699 (diff)
downloadtoybox-dcb52f7c9a01a0609a7d4f00256f6807ae49320b.tar.gz
Fix netcat -f
-rw-r--r--toys/netcat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/netcat.c b/toys/netcat.c
index 82039a91..1b51337e 100644
--- a/toys/netcat.c
+++ b/toys/netcat.c
@@ -99,8 +99,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) && toys.optc!=1) toys.exithelp++;
- if (!(toys.optflags&(FLAG_l|FLAG_L)) && toys.optc!=2) toys.exithelp++;
+ 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");