syslinux-3.08-2 sources from FC4
[bootcd.git] / syslinux / sample / atou.c
1 static inline int
2 isdigit(int ch)
3 {
4   return (ch >= '0') && (ch <= '9');
5 }
6
7 unsigned int atou(const char *s)
8 {
9   unsigned int i = 0;
10   while (isdigit(*s))
11     i = i*10 + (*s++ - '0');
12   return i;
13 }
14