Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, for more info) to build successfully.

Commit 97d13513 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Avoid potential for divide-by-zero error if called with total=0

Caught by Coverity.
parent 08f3f5c9
......@@ -1404,7 +1404,7 @@ void sbbs_t::progress(const char* text, int count, int total, int interval)
if((count%interval) != 0)
if(text == NULL) text = "";
float pct = ((float)count/total)*100.0F;
float pct = total ? ((float)count/total)*100.0F : 100.0F;
SAFEPRINTF2(str, "[ %-8s %4.1f%% ]", text, pct);
cursor_left(backfill(str, pct, cfg.color[clr_progress_full], cfg.color[clr_progress_empty]));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment