summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Bainbridge <jamie.bainbridge@gmail.com>2016-06-30 09:15:33 +1000
committerGitHub <noreply@github.com>2016-06-30 09:15:33 +1000
commit68a0f9980d04dc89b2fb29e5b721ad7606d9733b (patch)
treebfc373162fc56cbedbc20a6dda0b9c2b61d53c08
parent0e34f5d742dbced0374217501ed9db1a79034b35 (diff)
downloadtcpdump-68a0f9980d04dc89b2fb29e5b721ad7606d9733b.tar.gz
Don't accept zero -C or -W options
Rolling over into zero filesize makes no sense. Creating a rotating buffer of zero files makes no sense. Modify the checks for -C and -W to accept greater than one, not greater than zero. Signed-off-by: Jamie Bainbridge <jamie.bainbiridge@gmail.com>
-rw-r--r--tcpdump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcpdump.c b/tcpdump.c
index 1db35daa..282d44c9 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -864,7 +864,7 @@ main(int argc, char **argv)
case 'C':
Cflag = atoi(optarg) * 1000000;
- if (Cflag < 0)
+ if (Cflag <= 0)
error("invalid file size %s", optarg);
break;
@@ -1145,7 +1145,7 @@ main(int argc, char **argv)
case 'W':
Wflag = atoi(optarg);
- if (Wflag < 0)
+ if (Wflag <= 0)
error("invalid number of output files %s", optarg);
WflagChars = getWflagChars(Wflag);
break;