[cvslog] (2005-11-15 03:59:59 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Mon Nov 14 22:00:03 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2005-11-15 03:59:59 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     lib/eggdrop/sockbuf.c

Log message:

* Fixed an off-by-one error in sockbuf.c from last night's commit. Patch by
  Sven Trenkel.

---------------------- diff included ----------------------
Index: eggdrop1.9/lib/eggdrop/sockbuf.c
diff -u eggdrop1.9/lib/eggdrop/sockbuf.c:1.19 eggdrop1.9/lib/eggdrop/sockbuf.c:1.20
--- eggdrop1.9/lib/eggdrop/sockbuf.c:1.19	Sun Nov 13 22:44:43 2005
+++ eggdrop1.9/lib/eggdrop/sockbuf.c	Mon Nov 14 21:59:49 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: sockbuf.c,v 1.19 2005/11/14 04:44:43 wcc Exp $";
+static const char rcsid[] = "$Id: sockbuf.c,v 1.20 2005/11/15 03:59:49 wcc Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -174,7 +174,7 @@
 	int nbytes = 0;
 	sockbuf_t *sbuf = &sockbufs[idx];
 
-	if (sbuf->sock <= 0) return 0;
+	if (sbuf->sock < 0) return 0;
 	/* If it's not blocked already, write as much as we can. */
 	if (!(sbuf->flags & SOCKBUF_BLOCK)) {		
 		nbytes = write (sbuf->sock, data, len);
@@ -388,6 +388,7 @@
 	int nbytes;
 	sockbuf_t *sbuf = &sockbufs[idx];
 
+	if (sbuf->sock < 0) return;
 	/* Try to write any buffered data. */
 	errno = 0;
 	nbytes = write(sbuf->sock, sbuf->data, sbuf->len);
@@ -415,7 +416,7 @@
 	char buf[4097];
 	int nbytes;
 
-	if (sbuf->sock <= 0) return;
+	if (sbuf->sock < 0) return;
 	errno = 0;
 	nbytes = read(sbuf->sock, buf, sizeof(buf)-1);
 	if (nbytes > 0) {
----------------------- End of diff -----------------------



More information about the Changes mailing list