aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils/aes128ecb_encrypt_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/aes128ecb_encrypt_file.cpp')
-rw-r--r--utils/aes128ecb_encrypt_file.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/aes128ecb_encrypt_file.cpp b/utils/aes128ecb_encrypt_file.cpp
index 407dd44..2e24f04 100644
--- a/utils/aes128ecb_encrypt_file.cpp
+++ b/utils/aes128ecb_encrypt_file.cpp
@@ -25,7 +25,9 @@ namespace
std::ifstream::pos_type get_file_size(const std::string& path)
{
- std::ifstream ifs(path, std::ifstream::binary | std::ifstream::ate);
+ std::ifstream ifs;
+ ifs.exceptions(std::ifstream::badbit | std::ifstream::failbit);
+ ifs.open(path, std::ifstream::binary | std::ifstream::ate);
return ifs.tellg();
}
}