gio-launch-desktop: 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:15:23 +00:00
parent a429e56523
commit 3edd005dab

View File

@@ -129,7 +129,7 @@ journal_stream_fd (const char *identifier,
if (fd < 0)
goto fail;
salen = offsetof (struct sockaddr_un, sun_path) + strlen (sa.un.sun_path) + 1;
salen = offsetof (struct sockaddr_un, sun_path) + (socklen_t) strlen (sa.un.sun_path) + 1;
if (connect (fd, &sa.sa, salen) < 0)
goto fail;