atol.c 339 B

12345678910111213141516171819
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Header$ */
  6. #include <stdlib.h>
  7. #include <errno.h>
  8. long
  9. atol(const char *nptr)
  10. {
  11. long l;
  12. int e = errno;
  13. l = strtol(nptr, (char **)NULL, 10);
  14. errno = e;
  15. return l;
  16. }