Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
caf363d
)
ratequeue: Fix rehash bug again.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 31 Aug 2024 14:29:22 +0000
(16:29 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 31 Aug 2024 14:29:22 +0000
(16:29 +0200)
src/ratequeue.c
patch
|
blob
|
blame
|
history
diff --git
a/src/ratequeue.c
b/src/ratequeue.c
index
a05187a
..
c349f18
100644
(file)
--- a/
src/ratequeue.c
+++ b/
src/ratequeue.c
@@
-160,12
+160,13
@@
static void rehash(int nlen)
if(nlen <= SBUCKETS) {
nlen = SBUCKETS;
new = sbuckets;
- memset(sbuckets, 0, sizeof(sbuckets));
} else {
new = szmalloc(sizeof(*new) * (1 << nlen));
}
if(nlen == hashlen)
return;
+ if(new == sbuckets)
+ memset(sbuckets, 0, sizeof(sbuckets));
assert(old != new);
pl = 1 << hashlen; nl = 1 << nlen; m = nl - 1;
for(i = 0; i < pl; i++) {