Clean-up: simplify the implementation of dynamic buffer set_capacity
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 10:59:18 +0000 (06:59 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 13:19:12 +0000 (09:19 -0400)
Only use realloc() to implement set_capacity's logic. In the case
where buf is NULL, realloc acts like malloc() anyhow.

Moreover, the memory does not need to be zeroed on allocation since
size increases provide this guarantee.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>

No differences found
This page took 0.02544 seconds and 4 git commands to generate.