rpm  4.5
misc.c
Go to the documentation of this file.
1 
4 #include "system.h"
5 
6 #include "rpmbuild.h"
7 #include "debug.h"
8 
9 /*@-boundswrite@*/
10 int parseNum(const char * line, int * res)
11 {
12  char * s1 = NULL;
13  unsigned long rc;
14 
15  if (line == NULL) return 1;
16  rc = strtoul(line, &s1, 10);
17  if (res) *res = rc;
18  return (((*s1) || (s1 == line) || (rc == ULONG_MAX)) ? 1 : 0);
19 }
20 /*@=boundswrite@*/