summaryrefslogtreecommitdiff
path: root/build/misc.c
blob: 95b95937bb310cee3b325b0826505d846e7d468c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/** \ingroup rpmbuild
 * \file build/misc.c
 */
#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;
}