1: /*
   2: **  OCTAL ASCII TO INTEGER CONVERSION
   3: **
   4: **	The ascii string 'a' which represents an octal number
   5: **	is converted to binary and returned.  Conversion stops at any
   6: **	non-octal digit.
   7: **
   8: **	Note that the number may not have a sign, and may not have
   9: **	leading blanks.
  10: **
  11: **	(Intended for converting the status codes in users(FILE))
  12: */
  13: 
  14: oatoi(a)
  15: char    *a;
  16: {
  17:     register int    r;
  18:     register char   *p;
  19:     register char   c;
  20: 
  21:     r = 0;
  22:     p = a;
  23: 
  24:     while ((c = *p++) >= '0' && c <= '7')
  25:         r = (r << 3) | (c &= 7);
  26: 
  27:     return (r);
  28: }
Last modified: 1995-02-04
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1810
Valid CSS Valid XHTML 1.0 Strict