commit ec41323bd1f9a1356c72cf32dd766b1656bc1729
parent 86efa586f025ff57999107910d9437b3d9412f0f
Author: Jordan Ritter <jpr5@darkridge.com>
Date: Mon, 11 Sep 2006 05:24:37 +0000
fix bug #1499961: ``-s 0'' defaults to max size instead of an actual zero length
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/ngrep.c b/ngrep.c
@@ -248,9 +248,11 @@ int main(int argc, char **argv) {
case 'n':
max_matches = atoi(optarg);
break;
- case 's':
- snaplen = atoi(optarg);
- break;
+ case 's': {
+ uint16_t value = atoi(optarg);
+ if (value > 0)
+ snaplen = value;
+ } break;
case 'M':
re_multiline_match = 0;
break;