diff --git a/cmd/syncthing/verbose.go b/cmd/syncthing/verbose.go index 125ef1cd..9e9f90a0 100644 --- a/cmd/syncthing/verbose.go +++ b/cmd/syncthing/verbose.go @@ -125,7 +125,11 @@ func (s *verboseSvc) formatEvent(ev events.Event) string { folder := data["folder"].(string) current := data["current"].(int64) total := data["total"].(int64) - return fmt.Sprintf("Scanning folder %q, %d%% done", folder, 100*current/total) + var pct int64 + if total > 0 { + pct = 100 * current / total + } + return fmt.Sprintf("Scanning folder %q, %d%% done", folder, pct) case events.DevicePaused: data := ev.Data.(map[string]string)