From 073808aa50f0c78e2d6fea4f56f0b814b314eb42 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 26 Jul 2022 12:37:50 +0100 Subject: Code tidy : replace 0 with nullptr or true --- libqpdf/InputSource.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libqpdf/InputSource.cc') 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]"); } -- cgit v1.2.3-54-g00ecf