source: buchla-68k/libcio/atol.c@ cbe2c15

Last change on this file since cbe2c15 was f40a309, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Unix line breaks.

  • Property mode set to 100644
File size: 544 bytes
Line 
1/*
2 =============================================================================
3 atol.c -- ascii to long conversion
4 Version 3 -- 1987-06-29 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "ctype.h"
10
11long
12atol(cp)
13register char *cp;
14{
15 register long n;
16 register short sign;
17
18 sign = 0;
19
20 if (*cp EQ '-') {
21
22 ++cp;
23 sign = 1;
24
25 } else {
26
27 if (*cp EQ '+')
28 ++cp;
29 }
30
31 for (n = 0; isdigit(*cp); )
32 n = n * 10 + *cp++ - '0';
33
34 return(sign ? -n : n);
35}
Note: See TracBrowser for help on using the repository browser.