eris/scan_ulong.c

14 lines
250 B
C
Raw Normal View History

2011-08-16 14:36:11 -06:00
#include "scan.h"
unsigned int scan_ulong(const char *src,unsigned long *dest) {
register const char *tmp=src;
register int l=0;
register unsigned char c;
while ((c=*tmp-'0')<10) {
l=l*10+c;
++tmp;
}
*dest=l;
return tmp-src;
}