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
commitfa2c289ed664ec55de0f5a453ef65e27d13a51e0 (patch)
tree9de807510cf1edd37c1238b27028ced0b4355972
parent8b7a8b346d02f7c81b6078ea61fc545df55b0dc8 (diff)
downloadtxr-fa2c289ed664ec55de0f5a453ef65e27d13a51e0.tar.gz
txr-fa2c289ed664ec55de0f5a453ef65e27d13a51e0.tar.bz2
txr-fa2c289ed664ec55de0f5a453ef65e27d13a51e0.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;
}