projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean up and fix logic for making mmap fail on invalid/unsupported offsets
[musl]
/
src
/
string
/
wcsncpy.c
diff --git
a/src/string/wcsncpy.c
b/src/string/wcsncpy.c
index
0164208
..
4bede04
100644
(file)
--- a/
src/string/wcsncpy.c
+++ b/
src/string/wcsncpy.c
@@
-1,9
+1,9
@@
#include <wchar.h>
#include <wchar.h>
-wchar_t *wcsncpy(wchar_t *
d, const wchar_t *
s, size_t n)
+wchar_t *wcsncpy(wchar_t *
restrict d, const wchar_t *restrict
s, size_t n)
{
wchar_t *a = d;
{
wchar_t *a = d;
- while (n &&
(*d++ = *s++)) n--
;
+ while (n &&
*s) n--, *d++ = *s++
;
wmemset(d, 0, n);
return a;
}
wmemset(d, 0, n);
return a;
}