projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix undefined behavior in wcsto[ld] family functions
[musl]
/
src
/
stdlib
/
wcstod.c
diff --git
a/src/stdlib/wcstod.c
b/src/stdlib/wcstod.c
index
83f308d
..
0deb701
100644
(file)
--- a/
src/stdlib/wcstod.c
+++ b/
src/stdlib/wcstod.c
@@
-1,6
+1,7
@@
#include "shgetc.h"
#include "floatscan.h"
#include "stdio_impl.h"
#include "shgetc.h"
#include "floatscan.h"
#include "stdio_impl.h"
+#include <wchar.h>
#include <wctype.h>
/* This read function heavily cheats. It knows:
#include <wctype.h>
/* This read function heavily cheats. It knows:
@@
-32,8
+33,7
@@
static long double wcstox(const wchar_t *s, wchar_t **p, int prec)
unsigned char buf[64];
FILE f = {0};
f.flags = 0;
unsigned char buf[64];
FILE f = {0};
f.flags = 0;
- f.rpos = f.rend = 0;
- f.buf = buf + 4;
+ f.rpos = f.rend = f.buf = buf + 4;
f.buf_size = sizeof buf - 4;
f.lock = -1;
f.read = do_read;
f.buf_size = sizeof buf - 4;
f.lock = -1;
f.read = do_read;