diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-07 14:02:16 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-07 20:08:46 +0100 |
commit | df2f5c6a360bd7512d2280aa9cb582bc0aa622bd (patch) | |
tree | f7a036ddeee36a172e1903056e7f4ed49a323efd /libqpdf/QUtil.cc | |
parent | cfaae47dc6704a54e3e84decbfbe8840c33f2fc4 (diff) | |
download | qpdf-df2f5c6a360bd7512d2280aa9cb582bc0aa622bd.tar.zst |
Add QUtil::make_shared_array to help with PointerHolder transition
Diffstat (limited to 'libqpdf/QUtil.cc')
-rw-r--r-- | libqpdf/QUtil.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index 503d79f9..1f179fd5 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -735,9 +735,7 @@ QUtil::copy_string(std::string const& str) std::shared_ptr<char> QUtil::make_shared_cstr(std::string const& str) { - auto result = std::shared_ptr<char>( - new char[str.length() + 1], - std::default_delete<char[]>()); + auto result = QUtil::make_shared_array<char>(str.length() + 1); // Use memcpy in case string contains nulls result.get()[str.length()] = '\0'; memcpy(result.get(), str.c_str(), str.length()); |