diff options
author | Marius Vollmer <mvo@zagadka.de> | 2003-11-21 17:08:31 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2003-11-21 17:08:31 +0000 |
commit | 28a6e1b0b6be9f5d9ddd15b81f55da058d20f713 (patch) | |
tree | f2d0cbe6ff8b18e1e1c850756fafe211207f1b25 | |
parent | 018d4730feaca5e046dcb71d35ccfe54cd59279d (diff) | |
download | guile-28a6e1b0b6be9f5d9ddd15b81f55da058d20f713.tar.gz |
(scm_drain_input): Bug fix: only access the port after checking that
it indeed is one.
-rw-r--r-- | libguile/ports.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) |