From f3d7c26de1f575a14017a161ad1fdd2b93385e03 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 26 Sep 2009 18:36:04 +0000 Subject: removed qexc; non-compatible ABI change git-svn-id: svn+q:///qpdf/trunk@709 71b93d88-0707-0410-a8cf-f5a4172ac649 --- libqpdf/MD5.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'libqpdf/MD5.cc') diff --git a/libqpdf/MD5.cc b/libqpdf/MD5.cc index b05afa8b..8f6f7ecd 100644 --- a/libqpdf/MD5.cc +++ b/libqpdf/MD5.cc @@ -28,6 +28,7 @@ ///////////////////////////////////////////////////////////////////////// #include +#include #include #include @@ -330,15 +331,12 @@ void MD5::encodeDataIncrementally(char const* data, int len) DLL_EXPORT void MD5::encodeFile(char const *filename, int up_to_size) - throw (QEXC::System) { - FILE *file; unsigned char buffer[1024]; - if ((file = fopen (filename, "rb")) == NULL) - { - throw QEXC::System(std::string("MD5: can't open ") + filename, errno); - } + FILE *file = QUtil::fopen_wrapper( + std::string("MD5: open ") + filename, + fopen(filename, "rb")); int len; int so_far = 0; @@ -365,7 +363,8 @@ void MD5::encodeFile(char const *filename, int up_to_size) // Assume, perhaps incorrectly, that errno was set by the // underlying call to read.... (void) fclose(file); - throw QEXC::System(std::string("MD5: read error on ") + filename, errno); + QUtil::throw_system_error( + std::string("MD5: read error on ") + filename); } (void) fclose(file); @@ -446,7 +445,7 @@ MD5::checkFileChecksum(char const* const checksum, std::string actual_checksum = getFileChecksum(filename, up_to_size); result = (checksum == actual_checksum); } - catch (QEXC::System) + catch (std::runtime_error) { // Ignore -- return false } -- cgit v1.2.3-54-g00ecf