diff options
author | Mark H Weaver <mhw@netris.org> | 2014-11-11 23:14:26 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2014-11-11 23:32:57 -0500 |
commit | 10679f4c59fcffb0657219e28e38d15df8ad09a0 (patch) | |
tree | a5bd8cb3f83597e3dc02eda4c3beea96e18c58e8 /libguile | |
parent | 03242f398f3520b1b27caf5885c8d5600094f944 (diff) | |
download | guile-10679f4c59fcffb0657219e28e38d15df8ad09a0.tar.gz |
Fix bytevector-copy when applied to SRFI-4 homogeneous numeric vectors.
Fixes <http://bugs.gnu.org/18866>.
Reported by tantalum <sph@posteo.eu>.
* libguile/bytevectors.c (scm_bytevector_copy): Always create a VU8
bytevector.
* test-suite/tests/bytevectors.test: Add test.
Diffstat (limited to 'libguile')
-rw-r--r-- | libguile/bytevectors.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c index b21044038..b976c2110 100644 --- a/libguile/bytevectors.c +++ b/libguile/bytevectors.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2009, 2010, 2011, 2012, 2014 Free Software Foundation, Inc. +/* Copyright (C) 2009-2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -606,7 +606,7 @@ SCM_DEFINE (scm_bytevector_copy, "bytevector-copy", 1, 0, 0, c_len = SCM_BYTEVECTOR_LENGTH (bv); c_bv = SCM_BYTEVECTOR_CONTENTS (bv); - copy = make_bytevector (c_len, SCM_BYTEVECTOR_ELEMENT_TYPE (bv)); + copy = make_bytevector (c_len, SCM_ARRAY_ELEMENT_TYPE_VU8); c_copy = SCM_BYTEVECTOR_CONTENTS (copy); memcpy (c_copy, c_bv, c_len); |