From ebc3f31747cbd44cd7353ffa8bd7f05e4683520e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 24 Jan 2026 22:47:53 +0100 Subject: [PATCH] libredirect: fixup TAB -> SPACE for indentation The whole file is indented with 4 SPACEs, except two recently added functions that wrongly use TABs. Fixes: e6a936c760e078f5f2e52673d6c4b36f1f6d945b ("libredirect: add 'bind' for AF_UNIX") Fixes: 599a2f2fbe701b9ca2f12e9a97b77fc878e4cd0f ("libredirect: add 'connect' for AF_UNIX") --- pkgs/by-name/li/libredirect/libredirect.c | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/li/libredirect/libredirect.c b/pkgs/by-name/li/libredirect/libredirect.c index 011b5e6965c5..f700547c307c 100644 --- a/pkgs/by-name/li/libredirect/libredirect.c +++ b/pkgs/by-name/li/libredirect/libredirect.c @@ -117,14 +117,14 @@ WRAPPER(int, bind)(int socket, const struct sockaddr *addr, socklen_t addr_len) char buf[PATH_MAX]; const struct sockaddr *real_addr = addr; if (addr->sa_family == AF_UNIX) { - struct sockaddr_un real_addr_un = *(struct sockaddr_un *)addr; - const char *sun_path = rewrite(real_addr_un.sun_path, buf); - if (sun_path != real_addr_un.sun_path) { - strncpy(real_addr_un.sun_path, buf, sizeof(real_addr_un.sun_path) - 1); - real_addr_un.sun_path[sizeof(real_addr_un.sun_path) - 1] = '\0'; - real_addr = (struct sockaddr *)&real_addr_un; - addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(real_addr_un.sun_path) + 1; - } + struct sockaddr_un real_addr_un = *(struct sockaddr_un *)addr; + const char *sun_path = rewrite(real_addr_un.sun_path, buf); + if (sun_path != real_addr_un.sun_path) { + strncpy(real_addr_un.sun_path, buf, sizeof(real_addr_un.sun_path) - 1); + real_addr_un.sun_path[sizeof(real_addr_un.sun_path) - 1] = '\0'; + real_addr = (struct sockaddr *)&real_addr_un; + addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(real_addr_un.sun_path) + 1; + } } return bind_real(socket, real_addr, addr_len); } @@ -136,14 +136,14 @@ WRAPPER(int, connect)(int socket, const struct sockaddr *addr, socklen_t addr_le char buf[PATH_MAX]; const struct sockaddr *real_addr = addr; if (addr->sa_family == AF_UNIX) { - struct sockaddr_un real_addr_un = *(struct sockaddr_un *)addr; - const char *sun_path = rewrite(real_addr_un.sun_path, buf); - if (sun_path != real_addr_un.sun_path) { - strncpy(real_addr_un.sun_path, buf, sizeof(real_addr_un.sun_path) - 1); - real_addr_un.sun_path[sizeof(real_addr_un.sun_path) - 1] = '\0'; - real_addr = (struct sockaddr *)&real_addr_un; - addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(real_addr_un.sun_path) + 1; - } + struct sockaddr_un real_addr_un = *(struct sockaddr_un *)addr; + const char *sun_path = rewrite(real_addr_un.sun_path, buf); + if (sun_path != real_addr_un.sun_path) { + strncpy(real_addr_un.sun_path, buf, sizeof(real_addr_un.sun_path) - 1); + real_addr_un.sun_path[sizeof(real_addr_un.sun_path) - 1] = '\0'; + real_addr = (struct sockaddr *)&real_addr_un; + addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(real_addr_un.sun_path) + 1; + } } return connect_real(socket, real_addr, addr_len); }