test: prevent accidental division by zero

This commit is contained in:
Ben Noordhuis 2012-05-05 18:37:49 +02:00
parent 985b961d4e
commit ad024040fc

View File

@ -28,6 +28,9 @@ char executable_path[PATHMAX] = { '\0' };
static void log_progress(int total, int passed, int failed, const char* name) {
if (total == 0)
total = 1;
LOGF("[%% %3d|+ %3d|- %3d]: %s", (passed + failed) / total * 100,
passed, failed, name);
}