abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 0681dc8dafd9e5b6b988894e6ed882ad105bd3d2
parent 35b3f610151a42ac50462efe85781005f7fa97cd
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Tue, 15 May 2018 13:57:27 +0200

Constify maximum socket name length

Diffstat:
abduco.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/abduco.c b/abduco.c @@ -282,7 +282,7 @@ static bool create_socket_dir(struct sockaddr_un *sockaddr) { if (socketfd == -1) return false; - size_t maxlen = sizeof(sockaddr->sun_path); + const size_t maxlen = sizeof(sockaddr->sun_path); uid_t uid = getuid(); struct passwd *pw = getpwuid(uid); @@ -352,7 +352,7 @@ static bool create_socket_dir(struct sockaddr_un *sockaddr) { } static bool set_socket_name(struct sockaddr_un *sockaddr, const char *name) { - size_t maxlen = sizeof(sockaddr->sun_path); + const size_t maxlen = sizeof(sockaddr->sun_path); if (name[0] == '/') { if (strlen(name) >= maxlen) { errno = ENAMETOOLONG;