summaryrefslogtreecommitdiffstats
path: root/libtests/aes.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libtests/aes.cc')
-rw-r--r--libtests/aes.cc17
1 files changed, 3 insertions, 14 deletions
diff --git a/libtests/aes.cc b/libtests/aes.cc
index 4b11b5f9..b5a63d9a 100644
--- a/libtests/aes.cc
+++ b/libtests/aes.cc
@@ -1,5 +1,6 @@
#include <qpdf/Pl_AES_PDF.hh>
#include <qpdf/Pl_StdioFile.hh>
+#include <qpdf/QUtil.hh>
#include <stdio.h>
#include <string.h>
@@ -89,20 +90,8 @@ int main(int argc, char* argv[])
unsigned int hexkeylen = strlen(hexkey);
unsigned int keylen = hexkeylen / 2;
- FILE* infile = fopen(infilename, "rb"); // XXXX
- if (infile == 0)
- {
- std::cerr << "can't open " << infilename << std::endl;
- exit(2);
- }
-
- FILE* outfile = fopen(outfilename, "wb"); // XXXX
- if (outfile == 0)
- {
- std::cerr << "can't open " << outfilename << std::endl;
- exit(2);
- }
-
+ FILE* infile = QUtil::safe_fopen(infilename, "rb");
+ FILE* outfile = QUtil::safe_fopen(outfilename, "wb");
unsigned char* key = new unsigned char[keylen];
for (unsigned int i = 0; i < strlen(hexkey); i += 2)
{