diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-12 15:02:39 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-12 15:02:39 -0400 |
commit | 5b190e1bb6de059c031907499b85b8b21409ab7b (patch) | |
tree | 0ad7373d1815afe7aa17a0cdcd9198c747b3bc45 /src/stdlib | |
parent | 9046b2494ce369d64e389d540446a8415c165ee2 (diff) |
send endptr properly if we reach the NUL terminator
Diffstat (limited to 'src/stdlib')
-rw-r--r-- | src/stdlib/_strtoi.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stdlib/_strtoi.h b/src/stdlib/_strtoi.h index a46d6c0c..21b22ee9 100644 --- a/src/stdlib/_strtoi.h +++ b/src/stdlib/_strtoi.h @@ -112,6 +112,10 @@ nptr++; } + if (endptr && (*endptr == NULL)) { + *endptr = (void*)nptr; + } + if (overflow) { ret = (sign == 1) ? max : min; } else { |