]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_progress: fix < 10000 output
authorDaniel Stenberg <daniel@haxx.se>
Fri, 3 Oct 2025 08:18:27 +0000 (10:18 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 3 Oct 2025 11:47:49 +0000 (13:47 +0200)
Follow-up to e49698925c7f90e

Closes #18826

src/tool_progress.c

index b03fbf16a18aae89ec0052b543dda10cfcfe0a01..d29bfdc4dad5299d9d85294a34d60d2d6b81aaf8 100644 (file)
@@ -34,8 +34,10 @@ static char *max5data(curl_off_t bytes, char *max5)
   /* a signed 64-bit value is 8192 petabytes maximum */
   const char unit[] = { 'k', 'M', 'G', 'T', 'P', 0 };
   int k = 0;
-  if(bytes < 100000)
+  if(bytes < 100000) {
     msnprintf(max5, 6, "%5" CURL_FORMAT_CURL_OFF_T, bytes);
+    return max5;
+  }
 
   do {
     curl_off_t nbytes = bytes / 1024;