projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix various bugs in path and error handling in execvp/fexecve
[musl]
/
src
/
stdlib
/
wcstoimax.c
diff --git
a/src/stdlib/wcstoimax.c
b/src/stdlib/wcstoimax.c
index
50647f6
..
344fe3a
100644
(file)
--- a/
src/stdlib/wcstoimax.c
+++ b/
src/stdlib/wcstoimax.c
@@
-6,6
+6,7
@@
intmax_t wcstoimax(const wchar_t *s, wchar_t **p, int base)
{
intmax_t wcstoimax(const wchar_t *s, wchar_t **p, int base)
{
+ const wchar_t *s1 = s;
struct intparse ip = {0};
if (p) *p = (wchar_t *)s;
struct intparse ip = {0};
if (p) *p = (wchar_t *)s;
@@
-21,11
+22,11
@@
intmax_t wcstoimax(const wchar_t *s, wchar_t **p, int base)
for (; __intparse(&ip, (char[]){(*s&-(*s<128U))}, 1); s++);
if (p && ip.err != EINVAL)
for (; __intparse(&ip, (char[]){(*s&-(*s<128U))}, 1); s++);
if (p && ip.err != EINVAL)
- *p = (wchar_t *)s;
+ *p = (wchar_t *)s
1 + ip.cnt
;
if (ip.err) {
errno = ip.err;
if (ip.err) {
errno = ip.err;
- if (ip.err = EINVAL) return 0;
+ if (ip.err =
=
EINVAL) return 0;
return ip.neg ? INTMAX_MIN : INTMAX_MAX;
}
return ip.neg ? INTMAX_MIN : INTMAX_MAX;
}