提交 cb8dff21 编写于 作者: R Rich Felker

fix misplaced *'s in string functions (harmless)

上级 4095f833
...@@ -22,7 +22,7 @@ void *memccpy(void *dest, const void *src, int c, size_t n) ...@@ -22,7 +22,7 @@ void *memccpy(void *dest, const void *src, int c, size_t n)
k = ONES * c; k = ONES * c;
wd=(void *)d; ws=(const void *)s; wd=(void *)d; ws=(const void *)s;
for (; n>=sizeof(size_t) && !HASZERO(*ws^k); for (; n>=sizeof(size_t) && !HASZERO(*ws^k);
n-=sizeof(size_t), ws++, *wd++) *wd = *ws; n-=sizeof(size_t), ws++, wd++) *wd = *ws;
d=(void *)wd; s=(const void *)ws; d=(void *)wd; s=(const void *)ws;
} }
for (; n && (*d=*s)!=c; n--, s++, d++); for (; n && (*d=*s)!=c; n--, s++, d++);
......
...@@ -19,7 +19,7 @@ char *__stpncpy(char *d, const char *s, size_t n) ...@@ -19,7 +19,7 @@ char *__stpncpy(char *d, const char *s, size_t n)
if (!n || !*s) goto tail; if (!n || !*s) goto tail;
wd=(void *)d; ws=(const void *)s; wd=(void *)d; ws=(const void *)s;
for (; n>=sizeof(size_t) && !HASZERO(*ws); 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; d=(void *)wd; s=(const void *)ws;
} }
for (; n && (*d=*s); n--, s++, d++); for (; n && (*d=*s); n--, s++, d++);
......
...@@ -21,7 +21,7 @@ size_t strlcpy(char *d, const char *s, size_t n) ...@@ -21,7 +21,7 @@ size_t strlcpy(char *d, const char *s, size_t n)
if (n && *s) { if (n && *s) {
wd=(void *)d; ws=(const void *)s; wd=(void *)d; ws=(const void *)s;
for (; n>=sizeof(size_t) && !HASZERO(*ws); 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; d=(void *)wd; s=(const void *)ws;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册