projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6494c65
)
afh: Make sure we never return a negative chunk number.
author
Andre Noll
<maan@tuebingen.mpg.de>
Tue, 20 Dec 2016 20:18:27 +0000
(21:18 +0100)
committer
Andre Noll
<maan@tuebingen.mpg.de>
Wed, 28 Dec 2016 14:17:26 +0000
(15:17 +0100)
With the old code this could happen if chunk zero is empty.
afh_common.c
patch
|
blob
|
history
diff --git
a/afh_common.c
b/afh_common.c
index f36c32e20ec6332a24720d9bf106ab9b39d756ba..dfbf75132f4e4372eb0b4c95bff8ef25793dc545 100644
(file)
--- a/
afh_common.c
+++ b/
afh_common.c
@@
-295,8
+295,8
@@
int32_t afh_get_start_chunk(int32_t approx_chunk_num,
for (k = PARA_MAX(0, approx_chunk_num); k >= 0; k--)
if (get_chunk_len(k, afhi) > 0)
for (k = PARA_MAX(0, approx_chunk_num); k >= 0; k--)
if (get_chunk_len(k, afhi) > 0)
-
brea
k;
- return
k
;
+
return
k;
+ return
0
;
}
/**
}
/**