From 6e283659af0f95505e92a1826953509537f9d216 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Tue, 2 Oct 2012 02:57:59 +0000 Subject: [PATCH] workaround for a nasty CLN bug --- src/util/integer_cln_imp.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/util/integer_cln_imp.h b/src/util/integer_cln_imp.h index 5dfcae6d2..b86e0240c 100644 --- a/src/util/integer_cln_imp.h +++ b/src/util/integer_cln_imp.h @@ -60,7 +60,12 @@ private: void readInt(const cln::cl_read_flags& flags, const std::string& s, unsigned base) throw(std::invalid_argument) { try { - d_value = read_integer(flags, s.c_str(), NULL, NULL); + if(s.find_first_not_of('0') == std::string::npos) { + // string of all zeroes, CLN has a bug for these inputs + d_value = read_integer(flags, "0", NULL, NULL); + } else { + d_value = read_integer(flags, s.c_str(), NULL, NULL); + } } catch(...) { std::stringstream ss; ss << "Integer() failed to parse value \"" << s << "\" in base " << base; -- 2.30.2