Browse Source

fix wrong assert

Zero is valid for a fd.
Thomas Guillem 9 years ago
parent
commit
23cd4622f1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/netbios_session.c

+ 2 - 2
src/netbios_session.c

@@ -207,7 +207,7 @@ int               netbios_session_packet_send(netbios_session *s)
     ssize_t         to_send;
     ssize_t         sent;
 
-    assert(s && s->packet && s->socket && s->state > 0);
+    assert(s && s->packet && s->socket >= 0 && s->state > 0);
 
     s->packet->length = htons(s->packet_cursor);
     to_send           = sizeof(netbios_session_packet) + s->packet_cursor;
@@ -227,7 +227,7 @@ static ssize_t    netbios_session_get_next_packet(netbios_session *s)
     ssize_t         res;
     size_t          total, sofar;
 
-    assert(s != NULL && s->packet != NULL && s->socket && s->state > 0);
+    assert(s != NULL && s->packet != NULL && s->socket >= 0 && s->state > 0);
 
     // Only get packet header and analyze it to get only needed number of bytes
     // needed for the packet. This will prevent losing a part of next packet