]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_paramhlp: fix secs2ms()
authorPetar Popovic <pjoetri@gmail.com>
Mon, 4 Aug 2025 17:48:26 +0000 (19:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 4 Aug 2025 21:26:32 +0000 (23:26 +0200)
- remove one zero from digs[5]
- remove size of size

Closes #18167

src/tool_paramhlp.c

index 4c7c5a7906c2b0ffa6af6335aa33eaf5910463d5..43b5bee455a744b1b97139ba37ed31964cf0dfaf 100644 (file)
@@ -321,7 +321,7 @@ ParameterError secs2ms(long *valp, const char *str)
 {
   curl_off_t secs;
   long ms = 0;
-  const unsigned int digs[] = { 1, 10, 100, 1000, 10000, 1000000,
+  const unsigned int digs[] = { 1, 10, 100, 1000, 10000, 100000,
     1000000, 10000000, 100000000 };
   if(!str ||
      curlx_str_number(&str, &secs, LONG_MAX/1000 - 1))
@@ -334,7 +334,7 @@ ParameterError secs2ms(long *valp, const char *str)
       return PARAM_NUMBER_TOO_LARGE;
     /* how many milliseconds are in fracs ? */
     len = (str - s);
-    while((len > sizeof(CURL_ARRAYSIZE(digs)) || (fracs > LONG_MAX/100))) {
+    while((len > CURL_ARRAYSIZE(digs) || (fracs > LONG_MAX/100))) {
       fracs /= 10;
       len--;
     }