From 5077ec4624c417ef47828abf50aae8aea39297e1 Mon Sep 17 00:00:00 2001 From: caktux Date: Tue, 13 Jan 2015 12:49:53 -0500 Subject: [PATCH] apply fix for #597 to neth --- neth/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/neth/main.cpp b/neth/main.cpp index 1252b205b..638e9c624 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -379,13 +379,14 @@ int main(int argc, char** argv) mining = ~(unsigned)0; else if (isFalse(m)) mining = 0; - else if (int i = stoi(m)) - mining = i; else - { - cerr << "Unknown -m/--mining option: " << m << endl; - return -1; - } + try { + mining = stoi(m); + } + catch (...) { + cerr << "Unknown -m/--mining option: " << m << endl; + return -1; + } } else if (arg == "-b" || arg == "--bootstrap") bootstrap = true;