1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

Fix uninitialized variable error in some peek-char error cases

* libguile/ports.c (scm_peek_char): Don't require error cases to
  set *len.  Fixes a bug caught by GCC whereby an EOF while reading a
  multibyte character with iconv would leave len uninitialized.
This commit is contained in:
Andy Wingo 2013-11-27 19:50:13 +01:00
parent 6a9d9e3a62
commit fe8935d432

View file

@ -2221,7 +2221,7 @@ SCM_DEFINE (scm_peek_char, "peek-char", 0, 1, 0,
scm_t_wchar c; scm_t_wchar c;
char bytes[SCM_MBCHAR_BUF_SIZE]; char bytes[SCM_MBCHAR_BUF_SIZE];
long column, line; long column, line;
size_t len; size_t len = 0;
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_current_input_port (); port = scm_current_input_port ();