1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-04 04:52:47 -05:00

Correct code to insert into a doubly-linked list.

[originally from svn r2553]
This commit is contained in:
Ben Harris
2003-01-12 13:50:04 +00:00
parent 1b5cb7adf6
commit 05ae857752
3 changed files with 14 additions and 6 deletions

View File

@ -504,7 +504,8 @@ Socket mactcp_new(SockAddr addr, int port, int privport, int oobinline,
/* Add this to the list of all sockets */
ret->next = mactcp.socklist;
ret->prev = &mactcp.socklist;
ret->next->prev = &ret->next;
if (ret->next != NULL)
ret->next->prev = &ret->next;
mactcp.socklist = ret;
return (Socket)ret;