1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00
ULib/cdb/scan_ulong.c
2015-01-23 17:24:36 +01:00

12 lines
336 B
C

#include "scan.h"
unsigned int scan_ulong(register char *s,register unsigned long *u)
{
register unsigned int pos; register unsigned long result;
register unsigned long c;
pos = 0; result = 0;
while ((c = (unsigned long) (unsigned char) (s[pos] - '0')) < 10)
{ result = result * 10 + c; ++pos; }
*u = result; return pos;
}