From e59793e29ecb47c63b72de4f9d1e6d044a0ff6f2 Mon Sep 17 00:00:00 2001 From: наб Date: Mon, 11 Nov 2024 15:23:46 +0100 Subject: Turn char[APT_BUFFER_SIZE] buffers into std::array --- ftparchive/sources.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ftparchive/sources.cc') diff --git a/ftparchive/sources.cc b/ftparchive/sources.cc index a59224395..4c7a51dff 100644 --- a/ftparchive/sources.cc +++ b/ftparchive/sources.cc @@ -3,7 +3,7 @@ #include #include -// for memcpy +#include #include #include @@ -42,16 +42,16 @@ bool DscExtract::Read(std::string FileName) IsClearSigned = (FileName != F.Name()); std::ostringstream data; - char buffer[1024]; + std::array buffer; do { unsigned long long actual = 0; - if (F.Read(buffer, sizeof(buffer)-1, &actual) == false) + if (F.Read(buffer.data(), buffer.size()-1, &actual) == false) return _error->Errno("read", "Failed to read dsc file %s", FileName.c_str()); if (actual == 0) break; Length += actual; buffer[actual] = '\0'; - data << buffer; + data << buffer.data(); } while(true); // adding two newlines 'off record' for pkgTagSection.Scan() calls -- cgit v1.2.3-70-g09d2