projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
strtod: fix const diagnostic
[gnulib.git]
/
lib
/
strtod.c
diff --git
a/lib/strtod.c
b/lib/strtod.c
index
94eb817
..
64b62ff
100644
(file)
--- a/
lib/strtod.c
+++ b/
lib/strtod.c
@@
-200,7
+200,8
@@
strtod (const char *nptr, char **endptr)
double num;
const char *s = nptr;
double num;
const char *s = nptr;
- char *end;
+ const char *end;
+ char *endbuf;
/* Eat whitespace. */
while (locale_isspace (*s))
/* Eat whitespace. */
while (locale_isspace (*s))
@@
-211,7
+212,8
@@
strtod (const char *nptr, char **endptr)
if (*s == '-' || *s == '+')
++s;
if (*s == '-' || *s == '+')
++s;
- num = underlying_strtod (s, &end);
+ num = underlying_strtod (s, &endbuf);
+ end = endbuf;
if (c_isdigit (s[*s == '.']))
{
if (c_isdigit (s[*s == '.']))
{
@@
-224,7
+226,10
@@
strtod (const char *nptr, char **endptr)
if (! c_isxdigit (s[2 + (s[2] == '.')]))
end = s + 1;
else if (end <= s + 2)
if (! c_isxdigit (s[2 + (s[2] == '.')]))
end = s + 1;
else if (end <= s + 2)
- num = parse_number (s + 2, 16, 2, 4, 'p', &end);
+ {
+ num = parse_number (s + 2, 16, 2, 4, 'p', &endbuf);
+ end = endbuf;
+ }
else
{
const char *p = s + 2;
else
{
const char *p = s + 2;