summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/gpgv.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-11-12 13:29:09 +0000
committerJulian Andres Klode <jak@debian.org>2024-11-12 13:29:09 +0000
commit8fd0ebc330bcdbced85877ff48bf40582bf983f9 (patch)
tree9e8c83e567731fba5f00cc959b075fa0ee9533ba /apt-pkg/contrib/gpgv.cc
parent8342f913c05c453e784bf038745351047d09af0a (diff)
parenta05e6fe18329ff8d91acf10efd4a1408858b0fda (diff)
Merge branch 'more' into 'main'
APT_BUFFER_SIZE pkgTagFile default size. std::vector(1024) -> std::array<1024>. dpkgpm buffers See merge request apt-team/apt!390
Diffstat (limited to 'apt-pkg/contrib/gpgv.cc')
-rw-r--r--apt-pkg/contrib/gpgv.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc
index 225acae88..c5ea19aa8 100644
--- a/apt-pkg/contrib/gpgv.cc
+++ b/apt-pkg/contrib/gpgv.cc
@@ -28,15 +28,6 @@
#include <apti18n.h>
/*}}}*/
-// syntactic sugar to wrap a raw pointer with a custom deleter in a std::unique_ptr
-static std::unique_ptr<char, decltype(&free)> make_unique_char(void *const str = nullptr)
-{
- return {static_cast<char *>(str), &free};
-}
-static std::unique_ptr<FILE, decltype(&fclose)> make_unique_FILE(std::string const &filename, char const *const mode)
-{
- return {fopen(filename.c_str(), mode), &fclose};
-}
class LineBuffer /*{{{*/
{
@@ -207,9 +198,9 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
}
enum { DETACHED, CLEARSIGNED } releaseSignature = (FileGPG != File) ? DETACHED : CLEARSIGNED;
- auto sig = make_unique_char();
- auto data = make_unique_char();
- auto conf = make_unique_char();
+ std::unique_ptr<char, FreeDeleter> sig;
+ std::unique_ptr<char, FreeDeleter> data;
+ std::unique_ptr<char, FreeDeleter> conf;
// Dump the configuration so apt-key picks up the correct Dir values
{