diff options
author | Jay Berkenbilt <ejb@ql.org> | 2012-07-26 04:32:14 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2012-07-26 04:32:14 +0200 |
commit | f6893242148460170253ef0ae51a6cd4b5ec8f95 (patch) | |
tree | a1b1da811c10b11904a57434dc4d3f008e2d7a2f /examples | |
parent | 9c00874e7786fa38e15e9a4ddf9767b63e88386d (diff) | |
download | qpdf-f6893242148460170253ef0ae51a6cd4b5ec8f95.tar.zst |
Restore coverage case
Previous commit lost coverage case for buffer-based replaceStreamData.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pdf-double-page-size.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/pdf-double-page-size.cc b/examples/pdf-double-page-size.cc index c2eb48a3..8a1867aa 100644 --- a/examples/pdf-double-page-size.cc +++ b/examples/pdf-double-page-size.cc @@ -61,12 +61,7 @@ int main(int argc, char* argv[]) char const* password = (argc == 4) ? argv[3] : ""; // Text to prepend to each page's contents - char const* content = "2 0 0 2 0 0 cm\n"; - - // Copy text into a buffer without the null terminator - PointerHolder<Buffer> b = new Buffer(strlen(content)); - unsigned char* bp = b->getBuffer(); - memcpy(bp, (unsigned char*)content, strlen(content)); + std::string content = "2 0 0 2 0 0 cm\n"; try { @@ -80,7 +75,8 @@ int main(int argc, char* argv[]) QPDFObjectHandle& page = *iter; // Prepend the buffer to the page's contents - page.addPageContents(QPDFObjectHandle::newStream(&qpdf, b), true); + page.addPageContents( + QPDFObjectHandle::newStream(&qpdf, content), true); // Double the size of each of the content boxes doubleBoxSize(page, "/MediaBox"); |