aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/InputSource.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-07-26 13:37:50 +0200
committerm-holger <m-holger@kubitscheck.org>2022-07-26 14:40:13 +0200
commit073808aa50f0c78e2d6fea4f56f0b814b314eb42 (patch)
treee2598b807a59cab41825d3b36f33dce45c7ba4de /libqpdf/InputSource.cc
parentd27edd54c4b077de66c40f681ff5d0e266952884 (diff)
downloadqpdf-073808aa50f0c78e2d6fea4f56f0b814b314eb42.tar.zst
Code tidy : replace 0 with nullptr or true
Diffstat (limited to 'libqpdf/InputSource.cc')
-rw-r--r--libqpdf/InputSource.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/libqpdf/InputSource.cc b/libqpdf/InputSource.cc
index ba4c3cbc..33ab44d1 100644
--- a/libqpdf/InputSource.cc
+++ b/libqpdf/InputSource.cc
@@ -69,7 +69,7 @@ InputSource::findFirst(
" too small or too large of a character sequence");
}
- char* p = 0;
+ char* p = nullptr;
qpdf_offset_t buf_offset = offset;
size_t bytes_read = 0;
@@ -86,7 +86,8 @@ InputSource::findFirst(
// If p points to buf[size], since strlen(start_chars) is
// always >= 1, this overflow test will be correct for that
// case regardless of start_chars.
- if ((p == 0) || ((p + strlen(start_chars)) > (buf + bytes_read))) {
+ if ((p == nullptr) ||
+ ((p + strlen(start_chars)) > (buf + bytes_read))) {
if (p) {
QTC::TC(
"libtests",
@@ -117,7 +118,7 @@ InputSource::findFirst(
memchr(
p,
start_chars[0],
- bytes_read - QIntC::to_size(p - buf)))) != 0) {
+ bytes_read - QIntC::to_size(p - buf)))) != nullptr) {
if (p == buf) {
QTC::TC("libtests", "InputSource found match at buf[0]");
}