diff options
Diffstat (limited to 'src/libctor.cc')
-rw-r--r-- | src/libctor.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libctor.cc b/src/libctor.cc index d72d82b..2685ec0 100644 --- a/src/libctor.cc +++ b/src/libctor.cc @@ -17,7 +17,6 @@ #include <cstdlib> #include <span> - #include "ctor.h" #include "configure.h" #include "rebuild.h" @@ -25,6 +24,7 @@ #include "build.h" #include "unittest.h" #include "argparser.h" +#include "util.h" int main(int argc, char* argv[]) { @@ -221,10 +221,16 @@ Options: return res; } - auto verbose_env = std::getenv("V"); - if(verbose_env) + if(std::string value; get_env("V", value)) { - settings.verbose = std::atoi(verbose_env); + try + { + settings.verbose = std::stoi(value); + } + catch(...) + { + // not an integer + } } if(list_files) |