From 9288fe63ad3ac968356f653464f3c28def0f856f Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Wed, 22 May 2019 16:47:28 +0200 Subject: [PATCH] arg_string: return default value on parsing error --- repos/base/include/util/arg_string.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repos/base/include/util/arg_string.h b/repos/base/include/util/arg_string.h index 75782253f7..a7409cdf78 100644 --- a/repos/base/include/util/arg_string.h +++ b/repos/base/include/util/arg_string.h @@ -140,16 +140,18 @@ class Genode::Arg bool bool_value(bool default_value) const { bool result = default_value; - switch(_value.type()) { + switch (_value.type()) { /* result is passed to 'ascii_to' by reference */ case Token::IDENT:; if (ascii_to(_value.start(), result) == _value.len()) return result; + return default_value; case Token::STRING: if (ascii_to(_value.start()+1, result) == _value.len()-2) return result; + return default_value; default: /* read values 0 (false) / !0 (true) */