summaryrefslogtreecommitdiffstats
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
commit5b1e06e1617294a036ff6233f477af2410f54a0d (patch)
treee53066e7cfe00767090af2681a2cf5ac998f4b77
parent321ebc57b90ea943083486f7727f35d918812d03 (diff)
downloadtxr-5b1e06e1617294a036ff6233f477af2410f54a0d.tar.gz
txr-5b1e06e1617294a036ff6233f477af2410f54a0d.tar.bz2
txr-5b1e06e1617294a036ff6233f477af2410f54a0d.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.
-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);
}