]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl:progressbarinit: ignore column width from terminals < 20
authorDaniel Stenberg <daniel@haxx.se>
Tue, 14 Jan 2020 21:18:12 +0000 (22:18 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 16 Jan 2020 07:45:25 +0000 (08:45 +0100)
To avoid division by zero - or other issues.

Reported-by: Daniel Marjamäki
Closes #4818

src/tool_cb_prg.c

index 9d16ec7660f62fdb20ff4980a008723bd09ef88c..d4c1465904ea157a710d70f8a8da10bf59997423 100644 (file)
@@ -251,7 +251,8 @@ void progressbarinit(struct ProgressData *bar,
       }
     }
 #endif /* TIOCGSIZE */
-    bar->width = cols;
+    if(cols > 20)
+      bar->width = cols;
   }
 
   if(!bar->width)