Skip to content

Commit b5d9a38

Browse files
giulcioffiaentinger
authored andcommitted
Return 0 instead of -1 if write fails
1 parent 27ecd66 commit b5d9a38

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arduino/libraries/WiFi/src/WiFiClient.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ size_t WiFiClient::write(const uint8_t *buf, size_t size)
8989

9090
int result = lwip_send_r(_socket, (void*)buf, size, MSG_PEEK);
9191

92+
if (result < 0) {
93+
return 0;
94+
}
95+
9296
return result;
9397

9498
}

0 commit comments

Comments
 (0)