[geany/geany] 0f9b77: Fix division by 0
Jiří Techet
git-noreply at xxxxx
Sat Nov 8 18:57:54 UTC 2014
Branch: refs/heads/master
Author: Jiří Techet <techet at gmail.com>
Committer: Jiří Techet <techet at gmail.com>
Date: Sat, 18 Oct 2014 19:40:10 UTC
Commit: 0f9b778ae55b74c688970a532baf5ac99d607980
https://github.com/geany/geany/commit/0f9b778ae55b74c688970a532baf5ac99d607980
Log Message:
-----------
Fix division by 0
Modified Paths:
--------------
tagmanager/src/tm_tag.c
Modified: tagmanager/src/tm_tag.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -880,7 +880,7 @@ static GPtrArray *merge(GPtrArray *big_array, GPtrArray *small_array) {
/* on average, we are merging a value from small_array every
* len(big_array) / len(small_array) values - good approximation for fast jump
* step size */
- initial_step = big_array->len / small_array->len;
+ initial_step = (small_array->len > 0) ? big_array->len / small_array->len : 1;
initial_step = initial_step > 4 ? initial_step : 1;
step = initial_step;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list