From 27b25a10265724b6ab6af297653b72c5fb8754df Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 11 Jun 2021 19:45:01 -0400 Subject: Replace `!` with `== 0` for all calls to `strcasecmp()`. This was done to make it more readable. --- pullreqd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pullreqd.c b/pullreqd.c index f077a50..3645f2f 100644 --- a/pullreqd.c +++ b/pullreqd.c @@ -96,7 +96,7 @@ int init_socket(config *cfg) { /* Size of the socket address we're using. */ size_t sockaddr_size = 0; /* Set socket type to unix socket, if socket-type was set to unix, otherwise set it to network socket. */ - const int sock_type = (!strcasecmp(cfg->sock_type, "unix")) ? AF_UNIX : AF_INET; + const int sock_type = (strcasecmp(cfg->sock_type, "unix") == 0) ? AF_UNIX : AF_INET; if (sock_type == AF_UNIX) { size_t path_length = strlen(cfg->sock); @@ -180,7 +180,7 @@ void cleanup(config *cfg, int listen_socket) { if (listen_socket > 0) { close(listen_socket); /* Is this a unix domain socket? */ - if (!strcasecmp(cfg->sock_type, "unix")) { + if (strcasecmp(cfg->sock_type, "unix") == 0) { unlink(cfg->sock); } } -- cgit v1.2.3-13-gbd6f