summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/lib/ratoui.c
blob: 0a54cebbabbfe57eabcb596f62cc84588a9d0d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*	$FreeBSD$	*/

/*
 * Copyright (C) 1993-2001 by Darren Reed.
 *
 * See the IPFILTER.LICENCE file for details on licencing.
 *
 * Id: ratoui.c,v 1.4 2001/06/09 17:09:25 darrenr Exp
 */

#include "ipf.h"


int	ratoui(ps, pi, min, max)
char 	*ps;
u_int	*pi, min, max;
{
	u_int i;
	char *pe;

	i = (u_int)strtol(ps, &pe, 0);
	if (*pe != '\0' || i < min || i > max)
		return 0;
	*pi = i;
	return 1;
}
OpenPOWER on IntegriCloud