aboutsummaryrefslogtreecommitdiff
path: root/watch.c
diff options
context:
space:
mode:
Diffstat (limited to 'watch.c')
-rw-r--r--watch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/watch.c b/watch.c
index 7b2da43..43ada5d 100644
--- a/watch.c
+++ b/watch.c
@@ -41,7 +41,7 @@ const int major = 1;
#ifndef __dead
#define __dead __attribute__((noreturn))
#endif
-#define strlcpy(d,s,l) (strncpy(d,s,l), (d)[(l) - 1] = '\0')
+#define strlcpy(d,s,l) (strncpy(d,s,(l) - strlen(d) - 1), (d)[(l) - 1] = '\0')
#define strlcat(d,s,l) strncat(d,s,(l) - strlen(d) - 1)
#endif