diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-03-03 10:18:41 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-03-03 10:18:41 +0100 |
commit | dc327575a8564257d8b84d835d72bc4fe098ba46 (patch) | |
tree | 559682828c5676ab65ee9bf2b9dd72138b01f0a0 | |
parent | 3278efd3fa3fc106da5c5b704b26f35e5ec16ac4 (diff) | |
download | guile-dc327575a8564257d8b84d835d72bc4fe098ba46.tar.gz |
Fix off-by-one error in the off-by-one fix of `make-srfi-4-vector'.
This is a followup to d900a8557db21641413db8995a7cdc1453adbe1f ("Fix
off-by-one error when initializing vectors in `make-srfi-4-vector'.").
* libguile/srfi-4.c (scm_make_srfi_4_vector): Don't initialize RET when
LEN is zero.
-rw-r--r-- | libguile/srfi-4.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libguile/srfi-4.c b/libguile/srfi-4.c index cb92b80c7..85fbc2ddd 100644 --- a/libguile/srfi-4.c +++ b/libguile/srfi-4.c @@ -257,7 +257,8 @@ SCM_DEFINE (scm_make_srfi_4_vector, "make-srfi-4-vector", 2, 1, 0, case SCM_ARRAY_ELEMENT_TYPE_C64: { SCM ret = scm_i_make_typed_bytevector (scm_to_size_t (len), i); - if (SCM_UNBNDP (fill)) + + if (SCM_UNBNDP (fill) || scm_is_eq (len, SCM_INUM0)) ; /* pass */ else if (scm_is_true (scm_zero_p (fill))) memset (SCM_BYTEVECTOR_CONTENTS (ret), 0, |