summaryrefslogtreecommitdiff
path: root/build/misc.c
blob: 267ab950101fbe47a84a15f50b491b394908a615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "system.h"

#include "rpmbuild.h"

/** */
int parseNum(const char *line, int *res)
{
    char *s1;
    
    s1 = NULL;
    *res = strtoul(line, &s1, 10);
    if ((*s1) || (s1 == line) || (*res == ULONG_MAX)) {
	return 1;
    }

    return 0;
}