Mercurial > hg > cdb
view scan_ulong.c @ 17:d9c11148df3b default tip
shh...
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Thu, 28 Aug 2025 11:02:58 +0100 |
| parents | 2cb46628feec |
| children |
line wrap: on
line source
#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; }
