summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-15 10:32:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-15 10:32:11 -0700
commit2a9efb5e24125fa0fa7368fcedde75c18b0fab6e (patch)
tree9de807510cf1edd37c1238b27028ced0b4355972
parentd38cc809fe11ce97cca9fa54e9395f1f63210156 (diff)
downloadtxr-2a9efb5e24125fa0fa7368fcedde75c18b0fab6e.tar.gz
txr-2a9efb5e24125fa0fa7368fcedde75c18b0fab6e.tar.bz2
txr-2a9efb5e24125fa0fa7368fcedde75c18b0fab6e.zip
Fix wrong memset in new args handling function.
* args.c (args_cat_zap_from): Clear the area that was copied, starting at the index offset, rather than from argument zero. This bug could result in spurious retention due to failing to zap some arguments.
-rw-r--r--args.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/args.c b/args.c
index 9377d357..b2159b38 100644
--- a/args.c
+++ b/args.c
@@ -103,7 +103,7 @@ struct args *args_cat_zap_from(struct args *to, struct args *from, cnum index)
to->list = from->list;
memcpy(to->arg + to->fill, from->arg + index, size);
to->fill += from->fill - index;
- memset(from->arg, 0, size);
+ memset(from->arg + index, 0, size);
return to;
}