From 8cf7f2bfb542b1583aa525611179d1a545f945d5 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 5 Feb 2022 08:26:32 -0500 Subject: API contract: qpdf_get_qpdf_version() returns a static --- libqpdf/QPDF.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libqpdf/QPDF.cc') diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index ce534d6e..565c73f6 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -26,7 +26,9 @@ #include #include -std::string QPDF::qpdf_version(QPDF_VERSION); +// This must be a fixed value. This API returns a const reference to +// it, and the C API relies on its being static as well. +std::string const QPDF::qpdf_version(QPDF_VERSION); static char const* EMPTY_PDF = "%PDF-1.3\n" @@ -178,6 +180,7 @@ QPDF::StringDecrypter::decryptString(std::string& val) std::string const& QPDF::QPDFVersion() { + // The C API relies on this being a static value. return QPDF::qpdf_version; } -- cgit v1.2.3-70-g09d2