diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-10-15 10:32:11 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-10-15 10:32:11 -0700 |
commit | 2a9efb5e24125fa0fa7368fcedde75c18b0fab6e (patch) | |
tree | 9de807510cf1edd37c1238b27028ced0b4355972 | |
parent | d38cc809fe11ce97cca9fa54e9395f1f63210156 (diff) | |
download | txr-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |