File: scan_ulong.c

package info (click to toggle)
dot-forward 1:0.71-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 544 kB
  • sloc: ansic: 2,859; makefile: 321; sh: 131
file content (11 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (31)
1
2
3
4
5
6
7
8
9
10
11
#include "scan.h"

unsigned int scan_ulong(s,u) 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;
}