aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/rc4.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2023-05-20 17:29:09 +0200
committerGitHub <noreply@github.com>2023-05-20 17:29:09 +0200
commitfd17c8e3fe38a56abf50ce0edec1cde48d4f74cb (patch)
treec1efea1b140cac94dbaf496ae6ec5e0a621daa07 /libtests/rc4.cc
parenta6d7b79e65941238871c0c3d7d06b9bf246213ba (diff)
parente6577a1323cd813a92ddbc8841e1342c05de071a (diff)
downloadqpdf-fd17c8e3fe38a56abf50ce0edec1cde48d4f74cb.tar.zst
Merge pull request #963 from m-holger/tidy
Code tidy
Diffstat (limited to 'libtests/rc4.cc')
-rw-r--r--libtests/rc4.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/libtests/rc4.cc b/libtests/rc4.cc
index a6a1328e..300c6201 100644
--- a/libtests/rc4.cc
+++ b/libtests/rc4.cc
@@ -6,9 +6,9 @@
#include <qpdf/QUtil.hh>
#include <iostream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
static void
other_tests()
@@ -41,7 +41,7 @@ main(int argc, char* argv[])
char* outfilename = argv[3];
unsigned int hexkeylen = QIntC::to_uint(strlen(hexkey));
unsigned int keylen = hexkeylen / 2;
- unsigned char* key = new unsigned char[keylen + 1];
+ auto* key = new unsigned char[keylen + 1];
key[keylen] = '\0';
FILE* infile = QUtil::safe_fopen(infilename, "rb");
@@ -51,14 +51,14 @@ main(int argc, char* argv[])
t[1] = hexkey[i + 1];
t[2] = '\0';
- long val = strtol(t, 0, 16);
+ long val = strtol(t, nullptr, 16);
key[i / 2] = static_cast<unsigned char>(val);
}
FILE* outfile = QUtil::safe_fopen(outfilename, "wb");
- Pl_StdioFile* out = new Pl_StdioFile("stdout", outfile);
+ auto* out = new Pl_StdioFile("stdout", outfile);
// Use a small buffer size (64) for testing
- Pl_RC4* rc4 = new Pl_RC4("rc4", out, key, QIntC::to_int(keylen), 64U);
+ auto* rc4 = new Pl_RC4("rc4", out, key, QIntC::to_int(keylen), 64U);
delete[] key;
// 64 < buffer size < 512, buffer_size is not a power of 2 for testing