Don't use exceptions to detect abnormal behavior

https://isocpp.org/wiki/faq/exceptions#why-not-exceptions
This commit is contained in:
TheAssassin 2018-11-15 18:48:58 +01:00
parent 2e1a37ccf5
commit beb2ee15be

View File

@ -34,8 +34,7 @@ namespace linuxdeploy {
if (size == 0)
continue;
if (size > buf.size())
throw std::runtime_error("Read more bytes than buffer size");
assert(size <= buf.size());
auto outBufSize = outBuf.size();
outBuf.reserve(outBufSize + size + 1);