From 4dcfdac2f585acf1cb826420f335e854beef67ed Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 25 Nov 2007 16:13:56 +0000 Subject: [PATCH] initialize netconn->socket to -1 instead of 0 since 0 is a valid socket! --- src/api/api_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/api_lib.c b/src/api/api_lib.c index 36621f5e..6fd5e92c 100644 --- a/src/api/api_lib.c +++ b/src/api/api_lib.c @@ -87,7 +87,8 @@ netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, conn->recvmbox = SYS_MBOX_NULL; conn->acceptmbox = SYS_MBOX_NULL; conn->state = NETCONN_NONE; - conn->socket = 0; + /* initialize socket to -1 since 0 is a valid socket */ + conn->socket = -1; conn->callback = callback; conn->recv_avail = 0; #if LWIP_SO_RCVTIMEO