aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-11-16 16:06:19 +0100
committerm-holger <m-holger@kubitscheck.org>2023-11-17 16:55:11 +0100
commitd11622b6fd8a2d050414c3e6110f3ad68f7502af (patch)
tree73652875727acfc969273b858938a328020d783f
parent81823f4032caefd1050bccb207d315839c1c48db (diff)
downloadqpdf-d11622b6fd8a2d050414c3e6110f3ad68f7502af.tar.zst
Change Pl_Buffer to use std::string for storage
-rw-r--r--include/qpdf/Pl_Buffer.hh4
-rw-r--r--libqpdf/Pl_Buffer.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/qpdf/Pl_Buffer.hh b/include/qpdf/Pl_Buffer.hh
index 5030e10e..6cf4560a 100644
--- a/include/qpdf/Pl_Buffer.hh
+++ b/include/qpdf/Pl_Buffer.hh
@@ -33,7 +33,7 @@
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
#include <memory>
-#include <vector>
+#include <string>
class QPDF_DLL_CLASS Pl_Buffer: public Pipeline
{
@@ -78,7 +78,7 @@ class QPDF_DLL_CLASS Pl_Buffer: public Pipeline
Members(Members const&) = delete;
bool ready{true};
- std::vector<unsigned char> data;
+ std::string data;
};
std::shared_ptr<Members> m;
diff --git a/libqpdf/Pl_Buffer.cc b/libqpdf/Pl_Buffer.cc
index 766c04b5..072b04d4 100644
--- a/libqpdf/Pl_Buffer.cc
+++ b/libqpdf/Pl_Buffer.cc
@@ -19,7 +19,7 @@ Pl_Buffer::~Pl_Buffer() // NOLINT (modernize-use-equals-default)
void
Pl_Buffer::write(unsigned char const* buf, size_t len)
{
- m->data.insert(m->data.end(), buf, buf + len);
+ m->data.append(reinterpret_cast<char const*>(buf), len);
m->ready = false;
if (getNext(true)) {