diff options
author | Christian Hesse <mail@eworm.de> | 2019-09-04 12:14:46 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2019-09-06 11:53:23 +0200 |
commit | 1ba45ef26597b82aba81ab20f63a1cb2320dd15e (patch) | |
tree | 84b7b524a5d72fd654427a33985979f7ac8b88a6 | |
parent | a136e1b54c5b350ac631cf9a2f377cc9d8c5501a (diff) | |
download | udp514-journal-1ba45ef26597b82aba81ab20f63a1cb2320dd15e.tar.gz udp514-journal-1ba45ef26597b82aba81ab20f63a1cb2320dd15e.tar.zst |
move function to condition...
... and purge a variable.
-rw-r--r-- | udp514-journal.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/udp514-journal.c b/udp514-journal.c index 1065b99..9a1db8b 100644 --- a/udp514-journal.c +++ b/udp514-journal.c @@ -8,7 +8,7 @@ #include "udp514-journal.h" int main(int argc, char **argv) { - int sock, num; + int sock; socklen_t len; struct sockaddr_in cliAddr, servAddr; char buffer[BUFFER_SIZE]; @@ -42,9 +42,7 @@ int main(int argc, char **argv) { memset(buffer, 0, BUFFER_SIZE); len = sizeof(cliAddr); - num = recvfrom(sock, buffer, BUFFER_SIZE, 0, - (struct sockaddr *) &cliAddr, &len); - if (num < 0) { + if (recvfrom(sock, buffer, BUFFER_SIZE, 0, (struct sockaddr *) &cliAddr, &len) < 0) { perror("could not receive data"); continue; } |