Commit 0ded90eff979c0a329736861995b2516139de114
1 parent
b93c3409
fix problems or otherwise improve code based on issues raised by Klocwork
git-svn-id: svn+q:///qpdf/trunk@690 71b93d88-0707-0410-a8cf-f5a4172ac649
Showing
4 changed files
with
12 additions
and
12 deletions
libqpdf/PCRE.cc
| ... | ... | @@ -147,7 +147,7 @@ PCRE::Match::nMatches() const |
| 147 | 147 | return this->nmatches; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | -PCRE::PCRE(char const* pattern, int options) throw (Exception) | |
| 150 | +PCRE::PCRE(char const* pattern, int options) throw (PCRE::Exception) | |
| 151 | 151 | { |
| 152 | 152 | char const *errptr; |
| 153 | 153 | int erroffset; | ... | ... |
libqpdf/QPDF_linearization.cc
| ... | ... | @@ -113,19 +113,17 @@ QPDF::isLinearized() |
| 113 | 113 | } |
| 114 | 114 | else |
| 115 | 115 | { |
| 116 | - if ((p = (char*)memchr(p, '\0', tbuf_size - (p - buf))) != 0) | |
| 116 | + p = (char*)memchr(p, '\0', tbuf_size - (p - buf)); | |
| 117 | + assert(p != 0); | |
| 118 | + while ((p - buf < tbuf_size) && (*p == 0)) | |
| 117 | 119 | { |
| 118 | - QTC::TC("qpdf", "QPDF lindict null found"); | |
| 119 | - while ((p - buf < tbuf_size) && (*p == 0)) | |
| 120 | - { | |
| 121 | - ++p; | |
| 122 | - } | |
| 123 | - if ((p - buf) == tbuf_size) | |
| 124 | - { | |
| 125 | - break; | |
| 126 | - } | |
| 127 | - QTC::TC("qpdf", "QPDF lindict searching after null"); | |
| 120 | + ++p; | |
| 121 | + } | |
| 122 | + if ((p - buf) == tbuf_size) | |
| 123 | + { | |
| 124 | + break; | |
| 128 | 125 | } |
| 126 | + QTC::TC("qpdf", "QPDF lindict searching after null"); | |
| 129 | 127 | } |
| 130 | 128 | } |
| 131 | 129 | ... | ... |
libtests/flate.cc