summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-02-06 21:19:50 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-02-06 21:19:50 -0800
commit52c1aef14849e0f3f4ecb4f6177c48af3b352631 (patch)
tree1bca87f87a14d49531adeec27749c99a81a04172 /lisplib.c
parenta7881343e163ba29c31f946e9f943685bb977d6d (diff)
downloadtxr-52c1aef14849e0f3f4ecb4f6177c48af3b352631.tar.gz
txr-52c1aef14849e0f3f4ecb4f6177c48af3b352631.tar.bz2
txr-52c1aef14849e0f3f4ecb4f6177c48af3b352631.zip
buf: bugfix: buf-set-length not setting bytes.
* buf.c (buf_grow): Function removed; logic merged into buf_do_set_len. The bug fixed is that buf_grow was initializing just the newly allocated bytes to init_val. The bytes that must actually be initialized are those which lie between the old and new length, not in the allocated area. (make_buf): In make_buf, we don't have to initialize the entire buffer, but only bytes 0 through len - 1. Now calloc is only used when the initializing value is zero, and the buffer's allocation size is the same as the length. When the length is increase to protrude into the allocated uninitialized area, buf_do_set_len will now properly initialize that to the value given at that time. * txr.1: Update make-buf documentation not to say that all the bytes of the buffer are initialized.
Diffstat (limited to 'lisplib.c')
0 files changed, 0 insertions, 0 deletions