[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/01: put-bytevector, unget-bytevector: Allow start ==
From: |
Mark H. Weaver |
Subject: |
[Guile-commits] 01/01: put-bytevector, unget-bytevector: Allow start == bytevector length. |
Date: |
Mon, 31 Jul 2017 11:47:16 -0400 (EDT) |
mhw pushed a commit to branch stable-2.2
in repository guile.
commit ac0d3dcc533850d25f3e533c04c1c238a83f190b
Author: Mark H Weaver <address@hidden>
Date: Mon Jul 31 11:37:58 2017 -0400
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.
---
libguile/r6rs-ports.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index c2f97ff..e944c7a 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;