diff options
author | liljencrantz <liljencrantz@gmail.com> | 2008-01-14 02:49:05 +1000 |
---|---|---|
committer | liljencrantz <liljencrantz@gmail.com> | 2008-01-14 02:49:05 +1000 |
commit | 8d2564291d87c5014c76d7ffb8e06c19cec73b4c (patch) | |
tree | b8234c4bf08962285a7e61109d1a667789bfc4da | |
parent | 87db9517e928c9007c66ed5b23836db2dad2b693 (diff) |
Make sure fish_indent handles io erros
darcs-hash:20080113164905-75c98-b090ce79fb50a260874951525218cac65a097a6d.gz
-rw-r--r-- | fish_indent.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fish_indent.c b/fish_indent.c index 3fcb54de..59226ad8 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; } |