summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-01-03 22:44:04 +0100
committerJay Berkenbilt <ejb@ql.org>2013-01-03 22:44:04 +0100
commit9261f3b922c9374e9be9593e1bbfffcad3d78364 (patch)
tree225a0ae291eb6731336e84f9717c634989f1db14
parent80fa4e01a19157a567364f6044c6e917fbe889ad (diff)
downloadqpdf-9261f3b922c9374e9be9593e1bbfffcad3d78364.tar.zst
Detect binary attachments better
This fix eliminates a false test failure on some platforms and makes the binary test work properly whether characters with the high bit set, when treated as integers, are negative or not.
-rw-r--r--qpdf/test_driver.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc
index 239464ce..48017908 100644
--- a/qpdf/test_driver.cc
+++ b/qpdf/test_driver.cc
@@ -1188,7 +1188,7 @@ void runtest(int n, char const* filename1, char const* arg2)
bool is_binary = false;
for (size_t i = 0; i < data.size(); ++i)
{
- if (data[i] < 0)
+ if ((data[i] < 0) || (data[i] > 126))
{
is_binary = true;
break;