From 28a6e1b0b6be9f5d9ddd15b81f55da058d20f713 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Fri, 21 Nov 2003 17:08:31 +0000 Subject: [PATCH] (scm_drain_input): Bug fix: only access the port after checking that it indeed is one. --- libguile/ports.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libguile/ports.c b/libguile/ports.c index 438d6b78b..e3419dc33 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -318,10 +318,11 @@ SCM_DEFINE (scm_drain_input, "drain-input", 1, 0, 0, #define FUNC_NAME s_scm_drain_input { SCM result; - scm_t_port *pt = SCM_PTAB_ENTRY (port); + scm_t_port *pt; long count; SCM_VALIDATE_OPINPORT (1, port); + pt = SCM_PTAB_ENTRY (port); count = pt->read_end - pt->read_pos; if (pt->read_buf == pt->putback_buf)