summaryrefslogtreecommitdiff
path: root/sample/skipatou.c
blob: 1641a131da12edda08792beb8960bd0a0937359f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;
}