diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-09-23 02:48:25 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-09-23 02:48:25 -0400 |
commit | 82c41e92320c3f84bd6d24e21c5350a06e2fc831 (patch) | |
tree | 0764d73765dcc2a8547dc8ca55e74a42cd7cd868 /src/string | |
parent | debadaa238e90fce897b467a9efefcbbc0155d06 (diff) | |
download | musl-82c41e92320c3f84bd6d24e21c5350a06e2fc831.tar.gz musl-82c41e92320c3f84bd6d24e21c5350a06e2fc831.tar.xz musl-82c41e92320c3f84bd6d24e21c5350a06e2fc831.zip |
fix undefined pointer comparison in wmemmove
Diffstat (limited to 'src/string')
-rw-r--r-- | src/string/wmemmove.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string/wmemmove.c b/src/string/wmemmove.c index e406f3d5..d58cebac 100644 --- a/src/string/wmemmove.c +++ b/src/string/wmemmove.c @@ -1,9 +1,10 @@ #include <wchar.h> +#include <stdint.h> wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n) { wchar_t *d0 = d; - if ((size_t)(d-s) < n) + if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d) while (n--) d[n] = s[n]; else while (n--) *d++ = *s++; |