From cb149d41a370ea646f426e60a125eeccfbea40a4 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 30 Mar 2018 15:38:16 +0200 Subject: Change some code style --- blabouncer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'blabouncer.c') diff --git a/blabouncer.c b/blabouncer.c index 679c775..49e8f4b 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -87,13 +87,13 @@ void dochat(int *sockfd, char *buf) { FD_SET(STDIN, &rfds); // add STDIN (fd 0) to read fds to monitor FD_SET(*sockfd, &rfds); // add our network socket '' - if(select(*sockfd + 1, &rfds, NULL, NULL, NULL) < 0) { // network socket + 1, rfds, no writes, no exceptions/errors, no timeout + if (select(*sockfd + 1, &rfds, NULL, NULL, NULL) < 0) { // network socket + 1, rfds, no writes, no exceptions/errors, no timeout printf("receive error, exiting!?\n"); perror("select"); // TODO exit here? } - if(FD_ISSET(*sockfd, &rfds)) { + if (FD_ISSET(*sockfd, &rfds)) { printf("reading socket!\n"); if ((numbytes = recv(*sockfd, buf, MAXDATASIZE - 1, 0)) == -1) { @@ -110,7 +110,7 @@ void dochat(int *sockfd, char *buf) { printf("RECEIVED: %s\n",buf); } - if(FD_ISSET(STDIN, &rfds)) { + if (FD_ISSET(STDIN, &rfds)) { printf("reading stdin!\n"); outgoingmsgrc = getstdin(NULL, outgoingmsg, sizeof(outgoingmsg)); @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) { } // loop through all the results and connect to the first we can - for(p = servinfo; p != NULL; p = p->ai_next) { + for (p = servinfo; p != NULL; p = p->ai_next) { if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { perror("bouncer-server: socket"); continue; -- cgit v1.2.3