summaryrefslogtreecommitdiffstats
path: root/buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'buf.c')
-rw-r--r--buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/buf.c b/buf.c
index 192449c2..3e1ed76a 100644
--- a/buf.c
+++ b/buf.c
@@ -423,7 +423,7 @@ static void buf_get_bytes(val buf, val pos, mem_t *ptr, cnum size, val self)
cnum e = p + size;
cnum l = c_num(b->len);
- if (e >= l || e < 0)
+ if (e > l || e < 0)
uw_throwf(error_s, lit("~a: attempted read past buffer end"), self, nao);
memcpy(ptr, b->data + p, size);