X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstring%2Fstpncpy.c;h=0a2c2a9d716e1a9f0591d56e6e35a7c0a0fbe0ef;hb=c6383b7b10303457306932584fc23f24b5153a81;hp=473db17e9cd1c6682f0846731684537248864a81;hpb=9f19b3ec8dec1e9402e31172a74b72cd46d3da36;p=musl diff --git a/src/string/stpncpy.c b/src/string/stpncpy.c index 473db17e..0a2c2a9d 100644 --- a/src/string/stpncpy.c +++ b/src/string/stpncpy.c @@ -9,7 +9,7 @@ #define HIGHS (ONES * (UCHAR_MAX/2+1)) #define HASZERO(x) ((x)-ONES & ~(x) & HIGHS) -char *__stpncpy(char *d, const char *s, size_t n) +char *__stpncpy(char *restrict d, const char *restrict s, size_t n) { size_t *wd; const size_t *ws; @@ -19,7 +19,7 @@ char *__stpncpy(char *d, const char *s, size_t n) if (!n || !*s) goto tail; wd=(void *)d; ws=(const void *)s; for (; n>=sizeof(size_t) && !HASZERO(*ws); - n-=sizeof(size_t), ws++, *wd++) *wd = *ws; + n-=sizeof(size_t), ws++, wd++) *wd = *ws; d=(void *)wd; s=(const void *)ws; } for (; n && (*d=*s); n--, s++, d++);