summaryrefslogtreecommitdiffstats
path: root/scan_ulong.c
blob: b38df10753326faf408a18bfcf1f9755c5c7c00f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
unsigned int scan_ulong(register const char *s,register unsigned long *u)
{
	register unsigned int pos = 0;
	register unsigned long result = 0;
	register unsigned long c;
	while ((c = (unsigned long) (unsigned char) (s[pos] - '0')) < 10) {
		result = result * 10 + c;
		++pos;
	}
	*u = result;
	return pos;
}