summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/strto_l.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/strto_l.c')
-rw-r--r--libc/stdlib/strto_l.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/stdlib/strto_l.c b/libc/stdlib/strto_l.c
index 16b29f5d6..aed6ef346 100644
--- a/libc/stdlib/strto_l.c
+++ b/libc/stdlib/strto_l.c
@@ -137,7 +137,7 @@ unsigned long _strto_l(const char *str, char **endptr, int base, int uflag)
negative = 0; /* since unsigned returns ULONG_MAX */
}
#if _STRTO_ERRNO
- errno = ERANGE;
+ __set_errno(ERANGE);
#endif
} else {
number = number * base + digit;
@@ -155,7 +155,7 @@ unsigned long _strto_l(const char *str, char **endptr, int base, int uflag)
if (negative) {
if (!uflag && (number > ((unsigned long)(-(1+LONG_MIN)))+1)) {
#if _STRTO_ERRNO
- errno = ERANGE;
+ __set_errno(ERANGE);
#endif
return (unsigned long) LONG_MIN;
}
@@ -163,7 +163,7 @@ unsigned long _strto_l(const char *str, char **endptr, int base, int uflag)
} else {
if (!uflag && (number > (unsigned long) LONG_MAX)) {
#if _STRTO_ERRNO
- errno = ERANGE;
+ __set_errno(ERANGE);
#endif
return LONG_MAX;
}