diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2024-11-11 15:23:46 +0100 |
|---|---|---|
| committer | наб <nabijaczleweli@nabijaczleweli.xyz> | 2024-11-11 15:52:43 +0100 |
| commit | e59793e29ecb47c63b72de4f9d1e6d044a0ff6f2 (patch) | |
| tree | 5973246672cedba43849a5291db0f9e749b14713 /ftparchive/sources.cc | |
| parent | df72264891212bc9846649f3f769a1c44fe787bf (diff) | |
Turn char[APT_BUFFER_SIZE] buffers into std::array<char, APT_BUFFER_SIZE>
Diffstat (limited to 'ftparchive/sources.cc')
| -rw-r--r-- | ftparchive/sources.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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 <sstream> #include <string> -// for memcpy +#include <array> #include <cstring> #include <apt-pkg/error.h> @@ -42,16 +42,16 @@ bool DscExtract::Read(std::string FileName) IsClearSigned = (FileName != F.Name()); std::ostringstream data; - char buffer[1024]; + std::array<char, APT_BUFFER_SIZE> 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 |
