diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-11 19:45:01 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-11 19:45:01 -0400 |
commit | 27b25a10265724b6ab6af297653b72c5fb8754df (patch) | |
tree | 411fcc295489aa4b40c080953e7ce0b5311d12d2 /pullreqd.c | |
parent | c18a84bf93e1098b1a8d53c8f2a17b1afec1c848 (diff) |
Replace `!` with `== 0` for all calls to
`strcasecmp()`.
This was done to make it more readable.
Diffstat (limited to 'pullreqd.c')
-rw-r--r-- | pullreqd.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } } |