mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-10 08:42:02 +03:00
fix alignment logic in strlcpy
This commit is contained in:
parent
8442358d9d
commit
820fccdefe
@ -16,7 +16,7 @@ size_t strlcpy(char *d, const char *s, size_t n)
|
||||
const size_t *ws;
|
||||
|
||||
if (!n--) goto finish;
|
||||
if (((uintptr_t)s & ALIGN) != ((uintptr_t)d & ALIGN)) {
|
||||
if (((uintptr_t)s & ALIGN) == ((uintptr_t)d & ALIGN)) {
|
||||
for (; ((uintptr_t)s & ALIGN) && n && (*d=*s); n--, s++, d++);
|
||||
if (n && *s) {
|
||||
wd=(void *)d; ws=(const void *)s;
|
||||
|
Loading…
Reference in New Issue
Block a user