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

Summary: incorrect error checking for accept()
Product: SDL_net Reporter: Ivan <igagis>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: sezeroz
Version: 1.2.7   
Hardware: x86   
OS: Windows (XP)   

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!