Skip to content

Commit 65997be

Browse files
committed
Fix issue detected by Coverity Scan
CID: 1340285 (Division or modulo by zero) Signed-off-by: Noah Metzger <[email protected]>
1 parent d28631a commit 65997be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/textord/colfind.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,8 @@ void ColumnFinder::ComputeMeanColumnGap(bool any_multi_column) {
926926
&gap_samples);
927927
}
928928
mean_column_gap_ = any_multi_column && gap_samples > 0
929-
? total_gap / gap_samples : total_width / width_samples;
929+
? total_gap / gap_samples : width_samples > 0
930+
? total_width / width_samples : 0;
930931
}
931932

932933
//////// Functions that manipulate ColPartitions in the part_grid_ /////

0 commit comments

Comments
 (0)