aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 3b40e597d..004a46b52 100644
--- a/diff.c
+++ b/diff.c
@@ -1502,8 +1502,8 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
* under this directory (sources == 1).
*/
if (baselen && sources != 1) {
- int permille = this_dir * 1000 / changed;
- if (permille) {
+ if (this_dir) {
+ int permille = this_dir * 1000 / changed;
int percent = permille / 10;
if (percent >= dir->percent) {
fprintf(opt->file, "%s%4d.%01d%% %.*s\n", line_prefix,