From 07d75eb336264cab4eb4cabfde482ce0104eba2b Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 17 Oct 2021 16:21:01 +0200 Subject: [PATCH] Simplify net_send_all() There is no need to declare the variable before the loop. --- app/src/util/net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/util/net.c b/app/src/util/net.c index 17299424..2b5a0e5e 100644 --- a/app/src/util/net.c +++ b/app/src/util/net.c @@ -116,9 +116,8 @@ net_send(socket_t socket, const void *buf, size_t len) { ssize_t net_send_all(socket_t socket, const void *buf, size_t len) { size_t copied = 0; - ssize_t w = 0; while (len > 0) { - w = send(socket, buf, len, 0); + ssize_t w = send(socket, buf, len, 0); if (w == -1) { return copied ? (ssize_t) copied : -1; }