diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-04-28 22:51:33 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-04-28 22:51:33 +0200 |
| commit | 79ab5bc24fbcb542deb1a8ee21b5f1c19ab1e7f5 (patch) | |
| tree | cae9bf1a23d484e99f11281663ba6d532fd04f2f | |
| parent | f4e1b8558e1c3b7356a7d49bfab3a686601b00f4 (diff) | |
Cleanup: use std::vector<char> rather than a "variable" length array.
| -rw-r--r-- | src/lib/scp_uploader.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/scp_uploader.cc b/src/lib/scp_uploader.cc index 78ab1e7a4..faf482a43 100644 --- a/src/lib/scp_uploader.cc +++ b/src/lib/scp_uploader.cc @@ -122,18 +122,17 @@ LIBDCP_ENABLE_WARNINGS throw NetworkError(String::compose(_("Could not open %1 to send"), from)); } - boost::uintmax_t buffer_size = 64 * 1024; - char buffer[buffer_size]; + std::vector<char> buffer(64 * 1024); while (to_do > 0) { - int const t = min(to_do, buffer_size); - size_t const read = f.read(buffer, 1, t); + int const t = min(to_do, buffer.size()); + size_t const read = f.read(buffer.data(), 1, t); if (read != size_t(t)) { throw ReadFileError(from); } LIBDCP_DISABLE_WARNINGS - int const r = ssh_scp_write(_scp, buffer, t); + int const r = ssh_scp_write(_scp, buffer.data(), t); LIBDCP_ENABLE_WARNINGS if (r != SSH_OK) { throw NetworkError(String::compose(_("Could not write to remote file (%1)"), ssh_get_error(_session))); |
