src/network/core/packet.cpp
changeset 8248 1f991f0538f0
parent 6573 7624f942237f
child 6872 1c4a4a609f85
child 8609 8c0c3e9dd6a0
--- a/src/network/core/packet.cpp	Wed Oct 17 21:47:44 2007 +0000
+++ b/src/network/core/packet.cpp	Thu Oct 18 17:44:59 2007 +0000
@@ -133,7 +133,8 @@
 void Packet::Send_string(const char* data)
 {
 	assert(data != NULL);
-	assert(this->size < sizeof(this->buffer) - strlen(data) - 1);
+	/* The <= *is* valid due to the fact that we are comparing sizes and not the index. */
+	assert(this->size + strlen(data) + 1 <= sizeof(this->buffer));
 	while ((this->buffer[this->size++] = *data++) != '\0') {}
 }