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 | e9c8551f35f7f3042271dd4abba6909bc23aa229 (patch) | |
tree | 60ae8b744c62a01e75d27779b2aef4de378ac1e5 | |
parent | 0a562b428c0fb9651fcfe03ae0d6e40262e3695a (diff) | |
download | txr-e9c8551f35f7f3042271dd4abba6909bc23aa229.tar.gz txr-e9c8551f35f7f3042271dd4abba6909bc23aa229.tar.bz2 txr-e9c8551f35f7f3042271dd4abba6909bc23aa229.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); |