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 /methods/store.cc | |
| parent | df72264891212bc9846649f3f769a1c44fe787bf (diff) | |
Turn char[APT_BUFFER_SIZE] buffers into std::array<char, APT_BUFFER_SIZE>
Diffstat (limited to 'methods/store.cc')
| -rw-r--r-- | methods/store.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/methods/store.cc b/methods/store.cc index 8b30efaf3..23d6b43d0 100644 --- a/methods/store.cc +++ b/methods/store.cc @@ -21,6 +21,7 @@ #include <apt-pkg/hashes.h> #include <apt-pkg/strutl.h> +#include <array> #include <cstring> #include <string> #include <vector> @@ -103,10 +104,10 @@ bool StoreMethod::Fetch(FetchItem *Itm) /*{{{*/ Res.Size = 0; while (1) { - unsigned char Buffer[APT_BUFFER_SIZE]; + std::array<unsigned char, APT_BUFFER_SIZE> Buffer; unsigned long long Count = 0; - if (!From.Read(Buffer,sizeof(Buffer),&Count)) + if (!From.Read(Buffer.data(),Buffer.size(),&Count)) { if (To.IsOpen()) To.OpFail(); @@ -116,8 +117,8 @@ bool StoreMethod::Fetch(FetchItem *Itm) /*{{{*/ break; Res.Size += Count; - Hash.Add(Buffer,Count); - if (To.IsOpen() && To.Write(Buffer,Count) == false) + Hash.Add(Buffer.data(),Count); + if (To.IsOpen() && To.Write(Buffer.data(),Count) == false) { Failed = true; break; |
