summaryrefslogtreecommitdiff
path: root/src/reply-password/reply-password.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reply-password/reply-password.c')
-rw-r--r--src/reply-password/reply-password.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/reply-password/reply-password.c b/src/reply-password/reply-password.c
index a935d0f084..2f168985b4 100644
--- a/src/reply-password/reply-password.c
+++ b/src/reply-password/reply-password.c
@@ -41,14 +41,14 @@ static int send_on_socket(int fd, const char *socket_name, const void *packet, s
union {
struct sockaddr sa;
struct sockaddr_un un;
- } sa;
+ } sa = {
+ .un.sun_family = AF_UNIX,
+ };
assert(fd >= 0);
assert(socket_name);
assert(packet);
- zero(sa);
- sa.un.sun_family = AF_UNIX;
strncpy(sa.un.sun_path, socket_name, sizeof(sa.un.sun_path));
if (sendto(fd, packet, size, MSG_NOSIGNAL, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(socket_name)) < 0) {