mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Use strtonum now that we have it in libc as well.
This commit is contained in:
parent
d66735216f
commit
8744275265
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=156728
@ -569,35 +569,20 @@ main(int argc, char **argv)
|
|||||||
Debug = 1;
|
Debug = 1;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
#ifdef __OpenBSD__
|
|
||||||
delay = strtonum(optarg, 5, 60*60, &errstr);
|
delay = strtonum(optarg, 5, 60*60, &errstr);
|
||||||
if (errstr)
|
if (errstr)
|
||||||
#else
|
|
||||||
delay = strtol(optarg, &errstr, 10);
|
|
||||||
if ((delay < 5) || (delay > 60*60) ||
|
|
||||||
((errstr != NULL) && (*errstr != '\0')))
|
|
||||||
#endif
|
|
||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
filename = optarg;
|
filename = optarg;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
#ifdef __OpenBSD__
|
|
||||||
snaplen = strtonum(optarg, 0, PFLOGD_MAXSNAPLEN,
|
snaplen = strtonum(optarg, 0, PFLOGD_MAXSNAPLEN,
|
||||||
&errstr);
|
&errstr);
|
||||||
if (snaplen <= 0)
|
if (snaplen <= 0)
|
||||||
snaplen = DEF_SNAPLEN;
|
snaplen = DEF_SNAPLEN;
|
||||||
if (errstr)
|
if (errstr)
|
||||||
snaplen = PFLOGD_MAXSNAPLEN;
|
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;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
Xflag++;
|
Xflag++;
|
||||||
|
Loading…
Reference in New Issue
Block a user