Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / cmd / ipf / lib / common / ratoi.c
blobfb8552dfcc15646e75e0e8735a7ea23f9655999a
1 /*
2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: ratoi.c,v 1.4 2001/06/09 17:09:25 darrenr Exp $
7 */
9 #include "ipf.h"
12 int ratoi(ps, pi, min, max)
13 char *ps;
14 int *pi, min, max;
16 int i;
17 char *pe;
19 i = (int)strtol(ps, &pe, 0);
20 if (*pe != '\0' || i < min || i > max)
21 return 0;
22 *pi = i;
23 return 1;