diff options
author | Jay Berkenbilt <ejb@ql.org> | 2013-02-28 21:47:48 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2013-03-05 19:33:32 +0100 |
commit | 6b9297882e0106b5c0af53320673d6341b9bea91 (patch) | |
tree | 486ef480b4d16a3df7c37569a6dcd62ed29b9dbe /libtests | |
parent | 8be827761347b7a0a4ce6e7bdfa6fd4585606b21 (diff) | |
download | qpdf-6b9297882e0106b5c0af53320673d6341b9bea91.tar.zst |
Mark secure CRT warnings with comment
Put a specific comment marker next to every piece of code that MSVC
gives warning 4996 for. This warning is generated for calls to
functions that Microsoft considers insecure or deprecated. This
change is in preparation for fixing all these cases even though none
of them are actually incorrect or insecure as used in qpdf. The
comment marker makes them easier to find so they can be fixed in
subsequent commits.
Diffstat (limited to 'libtests')
-rw-r--r-- | libtests/aes.cc | 4 | ||||
-rw-r--r-- | libtests/flate.cc | 4 | ||||
-rw-r--r-- | libtests/lzw.cc | 4 | ||||
-rw-r--r-- | libtests/md5.cc | 2 | ||||
-rw-r--r-- | libtests/png_filter.cc | 4 | ||||
-rw-r--r-- | libtests/qutil.cc | 6 | ||||
-rw-r--r-- | libtests/rc4.cc | 4 |
7 files changed, 14 insertions, 14 deletions
diff --git a/libtests/aes.cc b/libtests/aes.cc index 5535cbb8..4b11b5f9 100644 --- a/libtests/aes.cc +++ b/libtests/aes.cc @@ -89,14 +89,14 @@ int main(int argc, char* argv[]) unsigned int hexkeylen = strlen(hexkey); unsigned int keylen = hexkeylen / 2; - FILE* infile = fopen(infilename, "rb"); + FILE* infile = fopen(infilename, "rb"); // XXXX if (infile == 0) { std::cerr << "can't open " << infilename << std::endl; exit(2); } - FILE* outfile = fopen(outfilename, "wb"); + FILE* outfile = fopen(outfilename, "wb"); // XXXX if (outfile == 0) { std::cerr << "can't open " << outfilename << std::endl; diff --git a/libtests/flate.cc b/libtests/flate.cc index dc65c565..d5f77162 100644 --- a/libtests/flate.cc +++ b/libtests/flate.cc @@ -10,10 +10,10 @@ FILE* safe_fopen(char const* filename, char const* mode) { - FILE* result = fopen(filename, mode); + FILE* result = fopen(filename, mode); // XXXX if (result == 0) { - std::cerr << "fopen " << filename << " failed: " << strerror(errno) + std::cerr << "fopen " << filename << " failed: " << strerror(errno) // XXXX << std::endl; exit(2); } diff --git a/libtests/lzw.cc b/libtests/lzw.cc index 6fd8ca91..1007ae24 100644 --- a/libtests/lzw.cc +++ b/libtests/lzw.cc @@ -27,9 +27,9 @@ int main(int argc, char* argv[]) char* outfilename = argv[2]; FILE* infile = QUtil::fopen_wrapper("open input file", - fopen(infilename, "rb")); + fopen(infilename, "rb")); // XXXX FILE* outfile = QUtil::fopen_wrapper("open output file", - fopen(outfilename, "wb")); + fopen(outfilename, "wb")); // XXXX Pl_StdioFile out("output", outfile); Pl_LZWDecoder decode("decode", &out, early_code_change); diff --git a/libtests/md5.cc b/libtests/md5.cc index ed6a7d7a..71d83f31 100644 --- a/libtests/md5.cc +++ b/libtests/md5.cc @@ -46,7 +46,7 @@ int main(int, char*[]) Pl_MD5 p("MD5", &d); for (int i = 0; i < 2; ++i) { - FILE* f = fopen("md5.in", "rb"); + FILE* f = fopen("md5.in", "rb"); // XXXX if (f) { // buffer size < size of md5.in diff --git a/libtests/png_filter.cc b/libtests/png_filter.cc index b735f338..68f50aee 100644 --- a/libtests/png_filter.cc +++ b/libtests/png_filter.cc @@ -9,10 +9,10 @@ FILE* safe_fopen(char const* filename, char const* mode) { - FILE* result = fopen(filename, mode); + FILE* result = fopen(filename, mode); // XXXX if (result == 0) { - std::cerr << "fopen " << filename << " failed: " << strerror(errno) + std::cerr << "fopen " << filename << " failed: " << strerror(errno) // XXXX << std::endl; exit(2); } diff --git a/libtests/qutil.cc b/libtests/qutil.cc index 4e8c7362..e293c374 100644 --- a/libtests/qutil.cc +++ b/libtests/qutil.cc @@ -66,7 +66,7 @@ void fopen_wrapper_test() { std::cout << "before fopen" << std::endl; f = QUtil::fopen_wrapper("fopen file", - fopen("/this/file/does/not/exist", "r")); + fopen("/this/file/does/not/exist", "r")); // XXXX std::cout << "after fopen" << std::endl; (void) fclose(f); } @@ -89,7 +89,7 @@ void getenv_test() static void print_utf8(unsigned long val) { char t[20]; - sprintf(t, "%lx", val); + sprintf(t, "%lx", val); // XXXX std::string result = QUtil::toUTF8(val); std::cout << "0x" << t << " ->"; if (val < 0xfffe) @@ -105,7 +105,7 @@ static void print_utf8(unsigned long val) iter != result.end(); ++iter) { char t[3]; - sprintf(t, "%02x", static_cast<unsigned char>(*iter)); + sprintf(t, "%02x", static_cast<unsigned char>(*iter)); // XXXX std::cout << " " << t; } } diff --git a/libtests/rc4.cc b/libtests/rc4.cc index 59a9265e..e71e0d01 100644 --- a/libtests/rc4.cc +++ b/libtests/rc4.cc @@ -22,7 +22,7 @@ int main(int argc, char* argv[]) unsigned char* key = new unsigned char[keylen + 1]; key[keylen] = '\0'; - FILE* infile = fopen(infilename, "rb"); + FILE* infile = fopen(infilename, "rb"); // XXXX if (infile == 0) { std::cerr << "can't open " << infilename << std::endl; @@ -40,7 +40,7 @@ int main(int argc, char* argv[]) key[i/2] = static_cast<unsigned char>(val); } - FILE* outfile = fopen(outfilename, "wb"); + FILE* outfile = fopen(outfilename, "wb"); // XXXX if (outfile == 0) { std::cerr << "can't open " << outfilename << std::endl; |