From 83bbab41127e5ee7778b54d29740cae21caa5d46 Mon Sep 17 00:00:00 2001 From: ado Date: Fri, 11 Dec 2020 00:57:44 +0100 Subject: [PATCH] fix extract bool --- include/ss/extract.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/ss/extract.hpp b/include/ss/extract.hpp index 8c40154..3230777 100644 --- a/include/ss/extract.hpp +++ b/include/ss/extract.hpp @@ -343,19 +343,21 @@ inline bool extract(const char* begin, const char* end, bool& value) { value = true; } else if (*begin == '0') { value = false; + } else { + return false; } - return true; } else { size_t size = end - begin; if (size == 4 && strncmp(begin, "true", size) == 0) { value = true; } else if (size == 5 && strncmp(begin, "false", size) == 0) { value = false; + } else { + return false; } - return true; } - return false; + return true; } template <>