From 9261f3b922c9374e9be9593e1bbfffcad3d78364 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 3 Jan 2013 16:44:04 -0500 Subject: 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. --- qpdf/test_driver.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3-54-g00ecf