aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_linearization.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2009-09-14 03:31:46 +0200
committerJay Berkenbilt <ejb@ql.org>2009-09-14 03:31:46 +0200
commit0ded90eff979c0a329736861995b2516139de114 (patch)
treec7f3ed5dc3481172f4a742de8869c8e52a9cb87a /libqpdf/QPDF_linearization.cc
parentb93c34099cee9f546d5aed2451568e2aaf51d00d (diff)
downloadqpdf-0ded90eff979c0a329736861995b2516139de114.tar.zst
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
Diffstat (limited to 'libqpdf/QPDF_linearization.cc')
-rw-r--r--libqpdf/QPDF_linearization.cc20
1 files changed, 9 insertions, 11 deletions
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");
}
}