about summary refs log tree commit diff
path: root/src/string/strncat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/strncat.c')
-rw-r--r--src/string/strncat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/strncat.c b/src/string/strncat.c
index 255b7a72..08685ad6 100644
--- a/src/string/strncat.c
+++ b/src/string/strncat.c
@@ -4,7 +4,7 @@ char *strncat(char *d, const char *s, size_t n)
 {
 	char *a = d;
 	d += strlen(d);
-	while (n && (*d++ = *s++)) n--;
+	while (n && *s) n--, *d++ = *s++;
 	*d++ = 0;
 	return a;
 }