common Util: Move to before decimal part calculation 95/289795/1
authorJunsuChoi <jsuya.choi@samsung.com>
Tue, 13 Dec 2022 02:53:50 +0000 (11:53 +0900)
committerMichal Szczecinski <mihashco89@gmail.com>
Tue, 14 Mar 2023 08:56:55 +0000 (09:56 +0100)
Change-Id: I96dc238736eec22f62831850628548ed60d0a08f

src/loaders/svg/tvgSvgUtil.cpp

index 11c861f..7fb108b 100644 (file)
@@ -137,11 +137,13 @@ float svgUtilStrtof(const char *nPtr, char **endPtr)
                     pow10 *= 10ULL;
                 }
             }
+        } else if (isspace(*iter)) { //skip if there is a space after the dot.
+            a = iter;
+            goto success;
         }
+
         val += static_cast<float>(decimalPart) / static_cast<float>(pow10);
         a = iter;
-        //skip if there is a space after the dot.
-        if (isspace(*a)) goto success;
     }
 
     //Optional: exponent