From: uz Date: Thu, 3 Jun 2010 21:37:27 +0000 (+0000) Subject: Use _seterrno instead of assigning to _errno. X-Git-Tag: V2.13.3~727 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aa8f817182aed47be5b43eaaa0b8464e2a8ed46d;p=cc65 Use _seterrno instead of assigning to _errno. git-svn-id: svn://svn.cc65.org/cc65/trunk@4705 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- 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; }