summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2017-07-31 11:37:58 -0400
committerMark H Weaver <mhw@netris.org>2017-07-31 11:37:58 -0400
commitac0d3dcc533850d25f3e533c04c1c238a83f190b (patch)
tree57f6fb1ed7ab3277219e425f0c4f2584cf8d867a
parent155ddcdc3bfc0d5e87397f18cd4cfb2f062fbb75 (diff)
downloadguile-ac0d3dcc533850d25f3e533c04c1c238a83f190b.tar.gz
put-bytevector, unget-bytevector: Allow start == bytevector length.
* libguile/r6rs-ports.c (scm_put_bytevector, scm_unget_bytevector): When three arguments (port bv start) are provided, allow start to be equal to the length of the bytevector, resulting in a zero-length write.
-rw-r--r--libguile/r6rs-ports.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index c2f97ffa1..e944c7aab 100644
--- a/libguile/r6rs-ports.c
+++ b/libguile/r6rs-ports.c
@@ -602,7 +602,7 @@ SCM_DEFINE (scm_put_bytevector, "put-bytevector", 2, 2, 0,
}
else
{
- if (SCM_UNLIKELY (c_start >= c_len))
+ if (SCM_UNLIKELY (c_start > c_len))
scm_out_of_range (FUNC_NAME, start);
else
c_count = c_len - c_start;
@@ -645,7 +645,7 @@ SCM_DEFINE (scm_unget_bytevector, "unget-bytevector", 2, 2, 0,
}
else
{
- if (SCM_UNLIKELY (c_start >= c_len))
+ if (SCM_UNLIKELY (c_start > c_len))
scm_out_of_range (FUNC_NAME, start);
else
c_count = c_len - c_start;