src/network/core/packet.cpp
changeset 8248 1f991f0538f0
parent 6573 7624f942237f
child 6872 1c4a4a609f85
child 8609 8c0c3e9dd6a0
equal deleted inserted replaced
8247:65822a1fba61 8248:1f991f0538f0
   131  * @param data   the string to send
   131  * @param data   the string to send
   132  */
   132  */
   133 void Packet::Send_string(const char* data)
   133 void Packet::Send_string(const char* data)
   134 {
   134 {
   135 	assert(data != NULL);
   135 	assert(data != NULL);
   136 	assert(this->size < sizeof(this->buffer) - strlen(data) - 1);
   136 	/* The <= *is* valid due to the fact that we are comparing sizes and not the index. */
       
   137 	assert(this->size + strlen(data) + 1 <= sizeof(this->buffer));
   137 	while ((this->buffer[this->size++] = *data++) != '\0') {}
   138 	while ((this->buffer[this->size++] = *data++) != '\0') {}
   138 }
   139 }
   139 
   140 
   140 
   141 
   141 /**
   142 /**