diff options
Diffstat (limited to 'src/packet.cpp')
-rw-r--r-- | src/packet.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/packet.cpp b/src/packet.cpp index 6664235f..133c72a8 100644 --- a/src/packet.cpp +++ b/src/packet.cpp @@ -31,21 +31,10 @@ Packet::Packet(const char *data, int length): // Create a copy of the data this->data = new char[length]; memcpy(this->data, data, length); - size = length; } Packet::~Packet() { // Clean up the data - if (data) - delete[] data; -} - -void Packet::expand(unsigned int bytes) -{ - char *newData = (char*)malloc(length + bytes); - memcpy(newData, (void*)data, length); - delete []data; - data = newData; - size += bytes; + delete[] data; } |