diff --git a/fish_indent.c b/fish_indent.c index 3fcb54d..59226ad 100644 --- a/fish_indent.c +++ b/fish_indent.c @@ -55,9 +55,16 @@ static void read_file( FILE *f, string_buffer_t *b ) { while( 1 ) { + errno=0; wint_t c = fgetwc( f ); if( c == WEOF ) { + if( errno ) + { + wperror(L"fgetwc"); + exit(1); + } + break; }