From: Rich Felker Date: Thu, 27 Dec 2012 04:48:02 +0000 (-0500) Subject: fix alignment logic in strlcpy X-Git-Tag: v0.9.9~42 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=820fccdefe3774d2902f0191966a5c2848405faa;p=oweals%2Fmusl.git fix alignment logic in strlcpy --- diff --git a/src/string/strlcpy.c b/src/string/strlcpy.c index 6aeb106a..4d3ff92a 100644 --- a/src/string/strlcpy.c +++ b/src/string/strlcpy.c @@ -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;