Fix net_send_all() warning
If len is not positive, w could be returned uninitialized.
This commit is contained in:
parent
e3d0a59c80
commit
41419a2e77
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ ssize_t 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) {
|
ssize_t net_send_all(socket_t socket, const void *buf, size_t len) {
|
||||||
ssize_t w;
|
ssize_t w = 0;
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
w = send(socket, buf, len, 0);
|
w = send(socket, buf, len, 0);
|
||||||
if (w == -1) {
|
if (w == -1) {
|
||||||
|
|
Loading…
Reference in a new issue