summary refs log tree commit diff
path: root/local.c
diff options
context:
space:
mode:
Diffstat (limited to 'local.c')
-rw-r--r--local.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/local.c b/local.c
index 1e19ae5..b3670ee 100644
--- a/local.c
+++ b/local.c
@@ -161,8 +161,10 @@ size_t localUnix(int fds[], size_t cap, const char *path) {
 	if (sock < 0) err(EX_OSERR, "socket");
 
 	struct sockaddr_un addr = { .sun_family = AF_UNIX };
-	size_t len = strlcpy(addr.sun_path, path, sizeof(addr.sun_path));
-	if (len >= sizeof(addr.sun_path)) {
+	int len = snprintf(
+		addr.sun_path, sizeof(addr.sun_path), "%s", path
+	);
+	if ((size_t)len >= sizeof(addr.sun_path)) {
 		errx(EX_CONFIG, "path too long: %s", path);
 	}