Browse Source

* f2b_filter_stats() : reset buffer before use

master
Alex 'AdUser' Z 8 years ago
parent
commit
0644fbe90b
  1. 1
      src/filter.c

1
src/filter.c

@ -183,6 +183,7 @@ f2b_filter_stats(f2b_filter_t *filter, char *res, size_t ressize) {
const char *fmt = const char *fmt =
"- pattern: %s\n" "- pattern: %s\n"
" matches: %d\n"; " matches: %d\n";
res[0] = '\0';
while (filter->stats(filter->cfg, &matches, &pattern, reset)) { while (filter->stats(filter->cfg, &matches, &pattern, reset)) {
snprintf(buf, sizeof(buf), fmt, pattern, matches); snprintf(buf, sizeof(buf), fmt, pattern, matches);
strlcat(res, buf, ressize); strlcat(res, buf, ressize);

Loading…
Cancel
Save