2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-26 07:12:45 +00:00

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.
This commit is contained in:
Jay Berkenbilt 2013-01-03 16:44:04 -05:00
parent 80fa4e01a1
commit 9261f3b922

View File

@ -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;