summaryrefslogtreecommitdiff
path: root/scan_8long.c
blob: 8b3a6df4e0734c1b9f93f5a4dbfd139e0d5937d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include "scan.h"

unsigned int scan_8long(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')) < 8)
    { result = result * 8 + c; ++pos; }
  *u = result; return pos;
}