devbridge: fix
This commit is contained in:
parent
3028437f8b
commit
f32ef135d4
|
@ -780,21 +780,15 @@ cachedump(Bridge *b)
|
||||||
Centry *ce;
|
Centry *ce;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
buf = smalloc(n);
|
|
||||||
qlock(b);
|
qlock(b);
|
||||||
if(waserror()) {
|
|
||||||
qunlock(b);
|
|
||||||
free(buf);
|
|
||||||
nexterror();
|
|
||||||
}
|
|
||||||
sec = TK2SEC(m->ticks);
|
sec = TK2SEC(m->ticks);
|
||||||
n = 0;
|
n = 0;
|
||||||
for(i=0; i<CacheSize; i++)
|
for(i=0; i<CacheSize; i++)
|
||||||
if(b->cache[i].expire != 0)
|
if(b->cache[i].expire != 0)
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
n *= 51; // change if print format is changed
|
n *= 51; // change if print format is changed
|
||||||
n += 10; // some slop at the end
|
n += 10; // some slop at the end
|
||||||
|
buf = smalloc(n);
|
||||||
p = buf;
|
p = buf;
|
||||||
ep = buf + n;
|
ep = buf + n;
|
||||||
ce = b->cache;
|
ce = b->cache;
|
||||||
|
@ -807,7 +801,6 @@ cachedump(Bridge *b)
|
||||||
ce->port, ce->src, ce->dst, ce->expire+off, c);
|
ce->port, ce->src, ce->dst, ce->expire+off, c);
|
||||||
}
|
}
|
||||||
*p = 0;
|
*p = 0;
|
||||||
poperror();
|
|
||||||
qunlock(b);
|
qunlock(b);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue