summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2006-03-15 00:30:19 +0000
committermlaier <mlaier@FreeBSD.org>2006-03-15 00:30:19 +0000
commit8e7c13433121e3ca9bf5b204dfa2889c2b9f7aaf (patch)
tree7bfcbe68bf8ba5443c0b416e085d76bbf13fadc4
parent29bd1e4139f62b8b18734922cf3c7b16726e2dac (diff)
downloadFreeBSD-src-8e7c13433121e3ca9bf5b204dfa2889c2b9f7aaf.zip
FreeBSD-src-8e7c13433121e3ca9bf5b204dfa2889c2b9f7aaf.tar.gz
Use strtonum now that we have it in libc as well.
-rw-r--r--contrib/pf/pflogd/pflogd.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/contrib/pf/pflogd/pflogd.c b/contrib/pf/pflogd/pflogd.c
index 6ef6a77..274f8ff 100644
--- a/contrib/pf/pflogd/pflogd.c
+++ b/contrib/pf/pflogd/pflogd.c
@@ -569,35 +569,20 @@ main(int argc, char **argv)
Debug = 1;
break;
case 'd':
-#ifdef __OpenBSD__
delay = strtonum(optarg, 5, 60*60, &errstr);
if (errstr)
-#else
- delay = strtol(optarg, &errstr, 10);
- if ((delay < 5) || (delay > 60*60) ||
- ((errstr != NULL) && (*errstr != '\0')))
-#endif
usage();
break;
case 'f':
filename = optarg;
break;
case 's':
-#ifdef __OpenBSD__
snaplen = strtonum(optarg, 0, PFLOGD_MAXSNAPLEN,
&errstr);
if (snaplen <= 0)
snaplen = DEF_SNAPLEN;
if (errstr)
snaplen = PFLOGD_MAXSNAPLEN;
-#else
- snaplen = strtol(optarg, &errstr, 10);
- if (snaplen <= 0)
- snaplen = DEF_SNAPLEN;
- if ((snaplen > PFLOGD_MAXSNAPLEN) ||
- ((errstr != NULL) && (*errstr != '\0')))
- snaplen = PFLOGD_MAXSNAPLEN;
-#endif
break;
case 'x':
Xflag++;
OpenPOWER on IntegriCloud