[Freeswitch-svn] [commit] r7102 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Sat Jan 5 16:47:24 EST 2008


Author: anthm
Date: Sat Jan  5 16:47:24 2008
New Revision: 7102

Modified:
   freeswitch/trunk/src/switch_utils.c

Log:
update

Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c	(original)
+++ freeswitch/trunk/src/switch_utils.c	Sat Jan  5 16:47:24 2008
@@ -70,7 +70,7 @@
 	switch_size_t total = 0;
 
 	p = buf;
-	while (total + sizeof(c) < len && (cur = read(fd, &c, sizeof(c))) > 0) {
+	while (total + 2 < len && (cur = read(fd, &c, 1)) == 1) {
 		total += cur;
 		*p++ = c;
 		if (c == '\r' || c == '\n') {
@@ -79,6 +79,7 @@
 	}
 
 	*p++ = '\0';
+	assert(total < len);
 	return total;
 }
 



More information about the Freeswitch-svn mailing list