aboutsummaryrefslogtreecommitdiff
path: root/riemann.fmi.uni-sofia.bg/programs/nlogin-0.3-pre/scan_ulong.c
blob: d2a68969d168adc434a3d461e6b966d80aa1bc0d (plain)
1
2
3
4
5
6
7
8
unsigned int scan_ulong(register char *s, register unsigned long *u) /*EXTRACT_INCL*/ {
  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;
}