mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 23:00:22 +02:00
(scm_drain_input): Bug fix: only access the port after checking that
it indeed is one.
This commit is contained in:
parent
018d4730fe
commit
28a6e1b0b6
1 changed files with 2 additions and 1 deletions
|
@ -318,10 +318,11 @@ SCM_DEFINE (scm_drain_input, "drain-input", 1, 0, 0,
|
||||||
#define FUNC_NAME s_scm_drain_input
|
#define FUNC_NAME s_scm_drain_input
|
||||||
{
|
{
|
||||||
SCM result;
|
SCM result;
|
||||||
scm_t_port *pt = SCM_PTAB_ENTRY (port);
|
scm_t_port *pt;
|
||||||
long count;
|
long count;
|
||||||
|
|
||||||
SCM_VALIDATE_OPINPORT (1, port);
|
SCM_VALIDATE_OPINPORT (1, port);
|
||||||
|
pt = SCM_PTAB_ENTRY (port);
|
||||||
|
|
||||||
count = pt->read_end - pt->read_pos;
|
count = pt->read_end - pt->read_pos;
|
||||||
if (pt->read_buf == pt->putback_buf)
|
if (pt->read_buf == pt->putback_buf)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue