OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [misc/] [atol.c] - Blame information for rev 199

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
2
 * This file is part of the Linux-8086 C library and is distributed
3
 * under the GNU Library General Public License.
4
 */
5
 
6
long
7
atol(number)
8
register char  *number;
9
{
10
   register long   n = 0, neg = 0;
11
 
12
   while (*number <= ' ' && *number > 0)
13
      ++number;
14
   if (*number == '-')
15
   {
16
      neg = 1;
17
      ++number;
18
   }
19
   else if (*number == '+')
20
      ++number;
21
   while (*number>='0' && *number<='9')
22
      n = (n * 10) + ((*number++) - '0');
23
   return (neg ? -n : n);
24
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.