Commit 9261f3b922c9374e9be9593e1bbfffcad3d78364
1 parent
80fa4e01
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.
Showing
1 changed file
with
1 additions
and
1 deletions
qpdf/test_driver.cc
| ... | ... | @@ -1188,7 +1188,7 @@ void runtest(int n, char const* filename1, char const* arg2) |
| 1188 | 1188 | bool is_binary = false; |
| 1189 | 1189 | for (size_t i = 0; i < data.size(); ++i) |
| 1190 | 1190 | { |
| 1191 | - if (data[i] < 0) | |
| 1191 | + if ((data[i] < 0) || (data[i] > 126)) | |
| 1192 | 1192 | { |
| 1193 | 1193 | is_binary = true; |
| 1194 | 1194 | break; | ... | ... |