equal
deleted
inserted
replaced
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 /** |