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 --- methods/store.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'methods') 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 #include +#include #include #include #include @@ -103,10 +104,10 @@ bool StoreMethod::Fetch(FetchItem *Itm) /*{{{*/ Res.Size = 0; while (1) { - unsigned char Buffer[APT_BUFFER_SIZE]; + std::array 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; -- cgit v1.2.3-70-g09d2