mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-22 20:40:29 +02:00
(scm_drain_input): Bug fix: only access the port after checking that
it indeed is one.
This commit is contained in:
parent
dd6f4cff17
commit
331bacec19
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -327,10 +327,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue