Permalink
Browse files

Check input file state in formatter.

  • Loading branch information...
kevingranade committed Oct 13, 2017
1 parent ba4030b commit 5fb539e1164d31f0ee8bf254aa75fdee24df43bf
Showing with 4 additions and 0 deletions.
  1. +4 −0 tools/format/format.cpp
View
@@ -134,6 +134,10 @@ int main( int argc, char *argv[] )
in << std::cin.rdbuf();
} else {
std::ifstream fin( filename, std::ios::binary );
if( !fin.good() ) {
std::cout << "Failed to open " << filename << std::endl;
exit( EXIT_FAILURE );
}
in << fin.rdbuf();
fin.close();
}

0 comments on commit 5fb539e

Please sign in to comment.