Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endPacket() return value if socket is unbound #245

Merged

Conversation

jrowberg
Copy link
Contributor

The endPacket() method returns 0 (failure) only in the case where WiFiSocket.sendto() returns < 0. However, the sendto() method returns exactly 0 in the case where the socket is not in a BOUND state. This allows endPacket() to indicate success after sendto() indicates failure. The simple fix is to change the condition to be <= 0 instead of < 0.

The endPacket() method returns 0 (failure) only in the case where WiFiSocket.sendto() returns < 0. However, the sendto() method returns exactly 0 in the case where the socket is not in a BOUND state. This allows endPacket() to indicate success after sendto() indicates failure. The simple fix is to change the condition to be <= 0 instead of < 0.
@sandeepmistry sandeepmistry merged commit d601bc8 into arduino-libraries:master Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants