Fix uninitialized variable error in some peek-char error cases
authorAndy Wingo <wingo@pobox.com>
Wed, 27 Nov 2013 18:50:13 +0000 (19:50 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 27 Nov 2013 18:50:13 +0000 (19:50 +0100)
* 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.

libguile/ports.c

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