1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

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.
This commit is contained in:
Mark H Weaver 2017-07-31 11:37:58 -04:00
parent 155ddcdc3b
commit ac0d3dcc53

View file

@ -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;