diff options
author | Luke Bratch <luke@bratch.co.uk> | 2018-03-30 15:38:16 +0200 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2018-03-30 15:38:16 +0200 |
commit | cb149d41a370ea646f426e60a125eeccfbea40a4 (patch) | |
tree | a0268b2b64e24e53438bcafaa304041a46912493 | |
parent | c69f622585f9c695aaa1b912978723986ceb01bf (diff) |
Change some code style
-rw-r--r-- | blabouncer.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |