X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstring%2Fstpncpy.c;fp=src%2Fstring%2Fstpncpy.c;h=473db17e9cd1c6682f0846731684537248864a81;hp=a877f5fe5e8d96d40adcade997dcde76807fd84d;hb=9f19b3ec8dec1e9402e31172a74b72cd46d3da36;hpb=a6238c30d169cbac6bc4c4977622242063e32270 diff --git a/src/string/stpncpy.c b/src/string/stpncpy.c index a877f5fe..473db17e 100644 --- a/src/string/stpncpy.c +++ b/src/string/stpncpy.c @@ -14,7 +14,7 @@ char *__stpncpy(char *d, const char *s, size_t n) size_t *wd; const size_t *ws; - 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) goto tail; wd=(void *)d; ws=(const void *)s;