diff options
author | Rob Landley <rob@landley.net> | 2008-12-08 00:16:07 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2008-12-08 00:16:07 -0600 |
commit | dcb52f7c9a01a0609a7d4f00256f6807ae49320b (patch) | |
tree | d7d72b9840881fbee3d0f4173d419953ef3994ba /toys | |
parent | 5f612e7749d9121433b9b7404c8e12c2fabd6699 (diff) | |
download | toybox-dcb52f7c9a01a0609a7d4f00256f6807ae49320b.tar.gz |
Fix netcat -f
Diffstat (limited to 'toys')
-rw-r--r-- | toys/netcat.c | 5 |
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"); |