diff options
author | m-holger <m-holger@kubitscheck.org> | 2023-03-07 20:02:49 +0100 |
---|---|---|
committer | m-holger <m-holger@kubitscheck.org> | 2023-03-08 10:56:53 +0100 |
commit | fc828c2a5093e6f4eda81c817b4db4a0c8bb0984 (patch) | |
tree | e21bdb0e950a2a0075b12b20288f1b7143ef8eb3 | |
parent | 71bba5d40dcbeac5bd2741ca155c111d9a3ee47b (diff) | |
download | qpdf-fc828c2a5093e6f4eda81c817b4db4a0c8bb0984.tar.zst |
Tidy QdfFixer::checkObjId
-rw-r--r-- | qpdf/fix-qdf.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/qpdf/fix-qdf.cc b/qpdf/fix-qdf.cc index 9992d26c..83632f4d 100644 --- a/qpdf/fix-qdf.cc +++ b/qpdf/fix-qdf.cc @@ -297,14 +297,12 @@ QdfFixer::processLines(std::list<std::string>& lines) void QdfFixer::checkObjId(std::string const& cur_obj_str) { - int cur_obj = QUtil::string_to_int(cur_obj_str.c_str()); - if (cur_obj != last_obj + 1) { + if (std::stoi(cur_obj_str) != ++last_obj) { fatal( filename + ":" + std::to_string(lineno) + ": expected object " + - std::to_string(last_obj + 1)); + std::to_string(last_obj)); } - last_obj = cur_obj; - xref.push_back(QPDFXRefEntry(1, QIntC::to_offset(last_offset), 0)); + xref.push_back(QPDFXRefEntry(1, last_offset, 0)); } void |