diff options
author | Jamie Bainbridge <jamie.bainbridge@gmail.com> | 2016-06-30 09:15:33 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-30 09:15:33 +1000 |
commit | 68a0f9980d04dc89b2fb29e5b721ad7606d9733b (patch) | |
tree | bfc373162fc56cbedbc20a6dda0b9c2b61d53c08 | |
parent | 0e34f5d742dbced0374217501ed9db1a79034b35 (diff) | |
download | tcpdump-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |