Browse Source

don't grow the buffer quite so large

David Rose 18 years ago
parent
commit
d505d4365c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      direct/src/dcparser/dcPackData.cxx

+ 1 - 1
direct/src/dcparser/dcPackData.cxx

@@ -30,7 +30,7 @@ static const size_t extra_size = 50;
 void DCPackData::
 void DCPackData::
 set_used_length(size_t size) {
 set_used_length(size_t size) {
   if (size > _allocated_size) {
   if (size > _allocated_size) {
-    _allocated_size = size * size + extra_size;
+    _allocated_size = size + size + extra_size;
     char *new_buf = new char[_allocated_size];
     char *new_buf = new char[_allocated_size];
     if (_used_length > 0) {
     if (_used_length > 0) {
       memcpy(new_buf, _buffer, _used_length);
       memcpy(new_buf, _buffer, _used_length);