summaryrefslogtreecommitdiffstats
path: root/ffi.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-07-05 07:17:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-07-05 07:17:13 -0700
commitfd8ff185fa67c33f73cb0096462562b9f421ab67 (patch)
treee53066e7cfe00767090af2681a2cf5ac998f4b77 /ffi.c
parentca78023b2bbd0c5996d2f21cd97a379e929929a7 (diff)
downloadtxr-fd8ff185fa67c33f73cb0096462562b9f421ab67.tar.gz
txr-fd8ff185fa67c33f73cb0096462562b9f421ab67.tar.bz2
txr-fd8ff185fa67c33f73cb0096462562b9f421ab67.zip
bugfix: broken carray-replace.
* ffi.c (carray_replace): Use original fn < vn loop guard, like in the original code that was replaced by the generic sequence iteration loop. For instance, when we replace a range like 1..1, fn == tn, and so the loop doesn't copy anything.
Diffstat (limited to 'ffi.c')
-rw-r--r--ffi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffi.c b/ffi.c
index 49f6303e..f872dcb8 100644
--- a/ffi.c
+++ b/ffi.c
@@ -4978,7 +4978,7 @@ val carray_replace(val carray, val values, val from, val to)
}
}
- for (; fn != tn; fn++, ptr += elsize) {
+ for (; fn < vn; fn++, ptr += elsize) {
val item = seq_geti(&item_iter);
eltft->put(eltft, item, ptr, self);
}