fix undefined pointer comparison in wmemmove
This commit is contained in:
1 parent
debadaa238
commit
82c41e9232
1 file changed
+2
-1
@@ -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++;
|
||||
|
||||
Reference in new issue
Block a user