Skip to content

Commit

Permalink
Correct format
Browse files Browse the repository at this point in the history
Signed-off-by: Shivshankar-Reddy <[email protected]>
Signed-off-by: hwware <[email protected]>
  • Loading branch information
Shivshankar-Reddy authored and hwware committed Jun 18, 2024
1 parent 1fa78f0 commit 46ee690
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/anet.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ int anetTcpAccept(char *err, int serversock, char *ip, size_t ip_len, int *port,
if (port) *port = ntohs(s->sin6_port);
}
if (client_addr) {
memcpy(client_addr, &sa, sizeof(sa));
memcpy(client_addr, &sa, sizeof(sa));
}
return fd;
}
Expand Down
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2880,7 +2880,7 @@ static int setConfigTrustedAddresses(standardConfig *config, sds *argv, int argc
skip++;
continue;
}
server.trustedIPList =
server.trustedIPList =
zrealloc(server.trustedIPList, sizeof(in_addr_t) * (server.trustedIPCount + j - skip + 1));
server.trustedIPList[j + server.trustedIPCount - skip] = addr;
sds_free((void *)ip);
Expand Down
2 changes: 1 addition & 1 deletion src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ void acceptCommonHandler(connection *conn, int flags, char *ip, const struct soc
char *err = "-ERR unable to retrieve valid IP address\r\n";

/* That's a best effort error message, don't check write errors */
if (connWrite(conn,err,strlen(err)) == -1) {
if (connWrite(conn, err, strlen(err)) == -1) {
/* Nothing to do, Just to avoid the warning... */
}
server.stat_rejected_conn++;
Expand Down
4 changes: 3 additions & 1 deletion src/trusted_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ void valkeySortIP(in_addr_t *IPlist, unsigned int IPcount) {
}

int checkTrustedIP(in_addr_t ip) {
return bsearch(&ip, server.trustedIPList, server.trustedIPCount, sizeof(server.trustedIPList[0]), compareIP) != NULL ? 1 : 0;
return bsearch(&ip, server.trustedIPList, server.trustedIPCount, sizeof(server.trustedIPList[0]), compareIP) != NULL
? 1
: 0;
}

int isUnixNetwork(client *c) {
Expand Down

0 comments on commit 46ee690

Please sign in to comment.