From aa8f817182aed47be5b43eaaa0b8464e2a8ed46d Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 3 Jun 2010 21:37:27 +0000 Subject: [PATCH] Use _seterrno instead of assigning to _errno. git-svn-id: svn://svn.cc65.org/cc65/trunk@4705 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/strtol.c | 4 ++-- libsrc/common/strtoul.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/common/strtol.c b/libsrc/common/strtol.c index b36dd8932..b7ccdf24c 100644 --- a/libsrc/common/strtol.c +++ b/libsrc/common/strtol.c @@ -71,7 +71,7 @@ long __fastcall__ strtol (const char* nptr, char** endptr, int base) } else if (isupper (*S)) { DigitVal = *S - ('A' - 10); } else if (islower (*S)) { - DigitVal = *S - ('a' - 10); + DigitVal = *S - ('a' - 10); } else { /* Unknown character */ break; @@ -110,7 +110,7 @@ long __fastcall__ strtol (const char* nptr, char** endptr, int base) /* Handle overflow */ if (Ovf) { - errno = ERANGE; + _seterrno (ERANGE); if (Minus) { return LONG_MIN; } else { diff --git a/libsrc/common/strtoul.c b/libsrc/common/strtoul.c index 15b01ec23..fa0d64f42 100644 --- a/libsrc/common/strtoul.c +++ b/libsrc/common/strtoul.c @@ -105,7 +105,7 @@ unsigned long __fastcall__ strtoul (const char* nptr, char** endptr, int base) /* Handle overflow */ if (Ovf) { - errno = ERANGE; + _seterrno (ERANGE); return ULONG_MAX; } -- 2.39.5