From ab0f56c2eb651a0c15f2ec9e19c0d8091a5a3c9a Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 6 Nov 2019 18:37:53 -0600 Subject: hscript: Use assertions since this should never ever happen --- hscript/disk.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hscript') diff --git a/hscript/disk.cc b/hscript/disk.cc index 07eca06..9c3b655 100644 --- a/hscript/disk.cc +++ b/hscript/disk.cc @@ -11,13 +11,13 @@ */ #include +#include /* assert */ #include /* strerror */ #include #include #include #ifdef HAS_INSTALL_ENV # include -# include /* assert */ # include /* blkid_get_tag_value */ # include "util/filesystem.hh" # include /* udev_* */ @@ -305,9 +305,8 @@ bool parse_size_string(const std::string &in_size, uint64_t *out_size, uint64_t multiplicand = 0; /* Validate parameters */ - if(out_size == nullptr || type == nullptr) { - return false; - } + assert(out_size != nullptr); + assert(type != nullptr); /* Simpler since the string isn't case-sensitive. */ std::transform(size.cbegin(), size.cend(), size.begin(), ::tolower); -- cgit v1.2.3-70-g09d2