summaryrefslogtreecommitdiff
path: root/build/misc.c
blob: 1e6b026e47a9b561304c09a2a59f995765dfde1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/** \ingroup rpmbuild
 * \file build/misc.c
 */
#include "system.h"

#include "rpmbuild.h"
#include "debug.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;
}