aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/compress.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/compress.cpp')
-rw-r--r--src/cli/compress.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/cli/compress.cpp b/src/cli/compress.cpp
index c60a33921..e9cd02290 100644
--- a/src/cli/compress.cpp
+++ b/src/cli/compress.cpp
@@ -8,6 +8,7 @@
#if defined(BOTAN_HAS_COMPRESSION)
#include <botan/compression.h>
+ #include <fstream>
#endif
namespace Botan_CLI {
@@ -75,17 +76,17 @@ class Compress final : public Command
while(in.good())
{
buf.resize(buf_size);
- in.read(reinterpret_cast<char*>(&buf[0]), buf.size());
+ in.read(reinterpret_cast<char*>(buf.data()), buf.size());
buf.resize(in.gcount());
compress->update(buf);
- out.write(reinterpret_cast<const char*>(&buf[0]), buf.size());
+ out.write(reinterpret_cast<const char*>(buf.data()), buf.size());
}
buf.clear();
compress->finish(buf);
- out.write(reinterpret_cast<const char*>(&buf[0]), buf.size());
+ out.write(reinterpret_cast<const char*>(buf.data()), buf.size());
out.close();
}
};
@@ -147,17 +148,17 @@ class Decompress final : public Command
while(in.good())
{
buf.resize(buf_size);
- in.read(reinterpret_cast<char*>(&buf[0]), buf.size());
+ in.read(reinterpret_cast<char*>(buf.data()), buf.size());
buf.resize(in.gcount());
decompress->update(buf);
- out.write(reinterpret_cast<const char*>(&buf[0]), buf.size());
+ out.write(reinterpret_cast<const char*>(buf.data()), buf.size());
}
buf.clear();
decompress->finish(buf);
- out.write(reinterpret_cast<const char*>(&buf[0]), buf.size());
+ out.write(reinterpret_cast<const char*>(buf.data()), buf.size());
out.close();
}
};