We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 569 - incorrect error checking for accept()
Summary: incorrect error checking for accept()
Status: RESOLVED FIXED
Alias: None
Product: SDL_net
Classification: Unclassified
Component: misc (show other bugs)
Version: 1.2.7
Hardware: x86 Windows (XP)
: P2 normal
Assignee: Sam Lantinga
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-17 06:42 UTC by Ivan
Modified: 2009-09-26 02:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan 2008-03-17 06:42:41 UTC
in case of error the accept() function returns INVALID_SOCKET, not SOCKET_ERROR.
Please change the error checking in file SDLnetTCP.cpp, line 844.

if ( sock->channel == SOCKET_ERROR ) {

should be changed to 

if ( sock->channel == INVALID_SOCKET ) {
Comment 1 Sam Lantinga 2009-09-26 02:27:33 UTC
This is in for the next release, thanks!