X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstring%2Fstrlcpy.c;h=193d724130eca36d7939819e2d7ec94889dca3ef;hb=60ab365cae24063b0f21821860ca16fb63e81f81;hp=6aeb106aa2e032c4d392631bb8fa9dd8a9f2e8bb;hpb=cb8dff2149c393c94c2abbef186c564829b97e93;p=musl diff --git a/src/string/strlcpy.c b/src/string/strlcpy.c index 6aeb106a..193d7241 100644 --- a/src/string/strlcpy.c +++ b/src/string/strlcpy.c @@ -1,5 +1,5 @@ +#define _BSD_SOURCE #include -#include #include #include #include "libc.h" @@ -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;