URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [misc/] [atol.c] - Rev 1765
Compare with Previous | Blame | View Log
/* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk> * This file is part of the Linux-8086 C library and is distributed * under the GNU Library General Public License. */ long atol(number) register char *number; { register long n = 0, neg = 0; while (*number <= ' ' && *number > 0) ++number; if (*number == '-') { neg = 1; ++number; } else if (*number == '+') ++number; while (*number>='0' && *number<='9') n = (n * 10) + ((*number++) - '0'); return (neg ? -n : n); }