gmessages: Fix -Wshorten-64-to-32 warning with socklen_t

`socklen_t` is defined as an `int`, but we’re putting a `size_t` sized
value into it. Socket paths are guaranteed to fit in a `socklen_t`, so
it’s OK to cast down.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3527
This commit is contained in:
Philip Withnall 2024-11-07 13:19:25 +00:00
parent 3edd005dab
commit 38d7e7e663
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -2383,7 +2383,7 @@ journal_sendv (struct iovec *iov,
memset (&mh, 0, sizeof (mh));
mh.msg_name = &sa;
mh.msg_namelen = offsetof (struct sockaddr_un, sun_path) + strlen (sa.sun_path);
mh.msg_namelen = offsetof (struct sockaddr_un, sun_path) + (socklen_t) strlen (sa.sun_path);
mh.msg_iov = iov;
mh.msg_iovlen = iovlen;