src/network/core/packet.cpp
changeset 7752 60a631bdca68
parent 6247 7d81e3a5d803
child 8113 31b7784db761
--- 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') {}
 }