diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-26 06:28:15 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-26 06:28:15 -0700 |
commit | be80aec475e95c31225375c42a6f1e0808056a1c (patch) | |
tree | 60ae8b744c62a01e75d27779b2aef4de378ac1e5 | |
parent | af9a912dc2bb853f32382cd1f9e7df3a673d50b4 (diff) | |
download | txr-be80aec475e95c31225375c42a6f1e0808056a1c.tar.gz txr-be80aec475e95c31225375c42a6f1e0808056a1c.tar.bz2 txr-be80aec475e95c31225375c42a6f1e0808056a1c.zip |
ffi: bugfix: varray alloc not accounting for null term.
* ffi.c (ffi_varray_alloc): Add tft->null_term to length.
-rw-r--r-- | ffi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -381,7 +381,7 @@ static mem_t *ffi_fixed_alloc(struct txr_ffi_type *tft, val obj, val self) static mem_t *ffi_varray_alloc(struct txr_ffi_type *tft, val obj, val self) { - cnum len = c_num(length(obj)); + cnum len = c_num(length(obj)) + tft->null_term; val eltype = tft->eltype; struct txr_ffi_type *etft = ffi_type_struct(eltype); return chk_calloc(len, etft->size); |