Skip to content

Commit

Permalink
Fix e2guardian#792 - dstat output buffer may be too small - buufer si…
Browse files Browse the repository at this point in the history
…ze increased to 200
  • Loading branch information
philipianpearce committed Jan 10, 2024
1 parent a391c97 commit dcfaa1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/FatController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void stat_rec::reset() {
rotate_dstat = false;
}

char outbuff[101];
char outbuff[201];

long cps = cnx / period;
long rqs = rqx / period;
Expand All @@ -188,11 +188,11 @@ void stat_rec::reset() {
timeinfo = localtime(&now);
char buffer[50];
strftime(buffer, 50, "%Y-%m-%d %H:%M", timeinfo);
snprintf(outbuff, 100, "%s %d %d %d %d %ld %ld %ld %ld %d %d", buffer,
snprintf(outbuff, 200, "%s %d %d %d %d %ld %ld %ld %ld %d %d", buffer,
o.proc.http_workers,
bc, o.http_worker_Q.size(), o.log.log_Q->size(), cnx, cps, rqx, rqs, mfd, LC);
} else {
snprintf(outbuff, 100, "%ld %d %d %d %d %ld %ld %ld %ld %d %d", now,
snprintf(outbuff, 200, "%ld %d %d %d %d %ld %ld %ld %ld %d %d", now,
o.proc.http_workers,
bc, o.http_worker_Q.size(), o.log.log_Q->size(), cnx, cps, rqx, rqs, mfd, LC);
}
Expand Down

0 comments on commit dcfaa1f

Please sign in to comment.