summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2016-02-24 17:13:50 -0800
committerManoj Srivastava <srivasta@debian.org>2016-02-24 17:13:50 -0800
commitc0a05c28fb4b8c56dd81fb4df25a57b29df7823d (patch)
tree2065f3be67e33f9fc50caf679f6a4247b5486ad9 /src
parentcf150317667c51cb679acfb11b133b78c80fee8a (diff)
parent2ee6529d711925d004fdfec56b8987f94997e69d (diff)
Merge branch 'fix-buffer-allocation'
Diffstat (limited to 'src')
-rw-r--r--src/buf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buf.c b/src/buf.c
index 00d8ad6..7e05abc 100644
--- a/src/buf.c
+++ b/src/buf.c
@@ -247,8 +247,8 @@ struct Buf *buf_append (buf, ptr, n_elem)
/* May need to alloc more. */
if (n_elem + buf->nelts > buf->nmax) {
- /* exact amount needed... */
- n_alloc = (n_elem + buf->nelts) * buf->elt_size;
+ /* exact count needed... */
+ n_alloc = n_elem + buf->nelts;
/* ...plus some extra */
if (((n_alloc * buf->elt_size) % 512) != 0