check for eof

This commit is contained in:
john30
2015-01-31 19:10:27 +01:00
parent 70609f1b03
commit 22b1138407
+3 -1
View File
@@ -134,8 +134,10 @@ int main(int argc, char* argv[])
if (file.is_open() == true) {
while (file.eof() == false) {
while (true) {
unsigned char byte = file.get();
if (file.eof() == true)
break;
cout << hex << setw(2) << setfill('0')
<< static_cast<unsigned>(byte) << endl;