diff options
-rw-r--r-- | libqpdf/PCRE.cc | 2 | ||||
-rw-r--r-- | libqpdf/QPDF_linearization.cc | 20 | ||||
-rw-r--r-- | libtests/flate.cc | 1 | ||||
-rw-r--r-- | libtests/png_filter.cc | 1 |
4 files changed, 12 insertions, 12 deletions
diff --git a/libqpdf/PCRE.cc b/libqpdf/PCRE.cc index 59174f67..872fde36 100644 --- a/libqpdf/PCRE.cc +++ b/libqpdf/PCRE.cc @@ -147,7 +147,7 @@ PCRE::Match::nMatches() const return this->nmatches; } -PCRE::PCRE(char const* pattern, int options) throw (Exception) +PCRE::PCRE(char const* pattern, int options) throw (PCRE::Exception) { char const *errptr; int erroffset; diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc index 2a81856e..281748b5 100644 --- a/libqpdf/QPDF_linearization.cc +++ b/libqpdf/QPDF_linearization.cc @@ -113,19 +113,17 @@ QPDF::isLinearized() } else { - if ((p = (char*)memchr(p, '\0', tbuf_size - (p - buf))) != 0) + p = (char*)memchr(p, '\0', tbuf_size - (p - buf)); + assert(p != 0); + while ((p - buf < tbuf_size) && (*p == 0)) { - QTC::TC("qpdf", "QPDF lindict null found"); - while ((p - buf < tbuf_size) && (*p == 0)) - { - ++p; - } - if ((p - buf) == tbuf_size) - { - break; - } - QTC::TC("qpdf", "QPDF lindict searching after null"); + ++p; + } + if ((p - buf) == tbuf_size) + { + break; } + QTC::TC("qpdf", "QPDF lindict searching after null"); } } diff --git a/libtests/flate.cc b/libtests/flate.cc index b6059a21..d05e7f92 100644 --- a/libtests/flate.cc +++ b/libtests/flate.cc @@ -15,6 +15,7 @@ FILE* safe_fopen(char const* filename, char const* mode) { std::cerr << "fopen " << filename << " failed: " << strerror(errno) << std::endl; + exit(2); } return result; } diff --git a/libtests/png_filter.cc b/libtests/png_filter.cc index 4a888bf9..a4b8a110 100644 --- a/libtests/png_filter.cc +++ b/libtests/png_filter.cc @@ -15,6 +15,7 @@ FILE* safe_fopen(char const* filename, char const* mode) { std::cerr << "fopen " << filename << " failed: " << strerror(errno) << std::endl; + exit(2); } return result; } |