Browse Source

Refine buffer allocation

pull/481/head
Max Lv 9 years ago
parent
commit
596f03665b
1 changed files with 1 additions and 1 deletions
  1. 2
      src/encrypt.c

2
src/encrypt.c

@ -217,8 +217,8 @@ int brealloc(buffer_t *ptr, size_t len, size_t capacity)
int real_capacity = max(len, capacity); int real_capacity = max(len, capacity);
if (ptr->capacity < real_capacity) { if (ptr->capacity < real_capacity) {
ptr->array = realloc(ptr->array, real_capacity); ptr->array = realloc(ptr->array, real_capacity);
ptr->capacity = real_capacity;
} }
ptr->capacity = real_capacity;
return real_capacity; return real_capacity;
} }

Loading…
Cancel
Save