From 19e474abca9149a42da3df65f67f670b072c1928 Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Sat, 23 Nov 2019 00:48:20 +0300 Subject: [PATCH] utils: fix base-10 condition --- code/espurna/utils.ino | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/espurna/utils.ino b/code/espurna/utils.ino index b2461713..fb8017a1 100644 --- a/code/espurna/utils.ino +++ b/code/espurna/utils.ino @@ -704,13 +704,10 @@ uint32_t u32fromString(const String& string) { base = 8; } else if (string.startsWith("0x")) { base = 16; - } else { - return 0; } - return u32fromString(string.substring(2), base); } - return u32fromString(string, base); + return u32fromString((base == 10) ? string : string.substring(2), base); } String u32toString(uint32_t value, int base) {