Skip to content

Commit

Permalink
Fix issue detected by Coverity Scan
Browse files Browse the repository at this point in the history
CID: 1340285 (Division or modulo by zero)

Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
  • Loading branch information
noahmetzger committed Aug 1, 2018
1 parent d28631a commit 65997be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/textord/colfind.cpp
Expand Up @@ -926,7 +926,8 @@ void ColumnFinder::ComputeMeanColumnGap(bool any_multi_column) {
&gap_samples);
}
mean_column_gap_ = any_multi_column && gap_samples > 0
? total_gap / gap_samples : total_width / width_samples;
? total_gap / gap_samples : width_samples > 0
? total_width / width_samples : 0;
}

//////// Functions that manipulate ColPartitions in the part_grid_ /////
Expand Down

0 comments on commit 65997be

Please sign in to comment.