summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/sample/skipatou.c
blob: ea2dbadc5ac6aff899f6f675d65958793a3b6907 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
static inline int isdigit(int ch)
{
    return (ch >= '0') && (ch <= '9');
}

unsigned int skip_atou(const char **s)
{
    int i = 0;

    while (isdigit(**s))
	i = i * 10 + *((*s)++) - '0';
    return i;
}