musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/string/strlcpy.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012年12月26日 23:48:02 -0500
committerRich Felker <dalias@aerifal.cx>2012年12月26日 23:48:02 -0500
commit820fccdefe3774d2902f0191966a5c2848405faa (patch)
tree4da70678635a43caa996e20d6d3d3c388c4d3443 /src/string/strlcpy.c
parent8442358d9dfc78261a5eab1f2cb13861c6e13207 (diff)
downloadmusl-820fccdefe3774d2902f0191966a5c2848405faa.tar.gz
fix alignment logic in strlcpy
Diffstat (limited to 'src/string/strlcpy.c')
-rw-r--r--src/string/strlcpy.c 2
1 files changed, 1 insertions, 1 deletions
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;
generated by cgit v1.2.1 (git 2.18.0) at 2025年10月01日 14:02:15 +0000

AltStyle によって変換されたページ (->オリジナル) /