From beb2ee15becd7528319666ff86c421a9e95abbc0 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Thu, 15 Nov 2018 18:48:58 +0100 Subject: [PATCH] Don't use exceptions to detect abnormal behavior https://isocpp.org/wiki/faq/exceptions#why-not-exceptions --- src/util/subprocess.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/subprocess.cpp b/src/util/subprocess.cpp index 4a4f06a..3416260 100644 --- a/src/util/subprocess.cpp +++ b/src/util/subprocess.cpp @@ -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);