From 531f899a00622228dfc0056aa8a9d17f0b1741f4 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 30 Apr 2005 14:46:17 +0000 Subject: [PATCH] . original commit: 03e76c4d3be4e535411833f96805be225f223218 --- collects/mzlib/port.ss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/collects/mzlib/port.ss b/collects/mzlib/port.ss index 793c6ab..269a98f 100644 --- a/collects/mzlib/port.ss +++ b/collects/mzlib/port.ss @@ -1210,7 +1210,8 @@ (set! buf-end (- buf-end buf-start)) (set! buf-start 0)) (let* ([amt (bytes-length s)] - [c (read-bytes-avail!* buf port buf-end (+ buf-end amt))]) + [c (read-bytes-avail!* buf port buf-end (min (bytes-length buf) + (+ buf-end amt)))]) (cond [(or (eof-object? c) (procedure? c))