syslogd: Change f_prevcount type; int --> size_t

If it wraps around to zero we want to log the message anyway.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2019-11-28 14:39:12 +01:00
parent 90a993f5a2
commit 49e168601e
2 changed files with 2 additions and 2 deletions

View File

@ -1725,7 +1725,7 @@ static void fprintlog_successive(struct filed *f, int flags)
buffer.timestamp = f->f_lasttime; buffer.timestamp = f->f_lasttime;
buffer.flags = flags; buffer.flags = flags;
snprintf(msg, sizeof(msg), "last message buffered %d times", snprintf(msg, sizeof(msg), "last message buffered %zd times",
f->f_prevcount); f->f_prevcount);
buffer.msg = msg; buffer.msg = msg;

View File

@ -264,7 +264,7 @@ struct filed {
char f_prevhost[MAXHOSTNAMELEN + 1]; /* host from which recd. */ char f_prevhost[MAXHOSTNAMELEN + 1]; /* host from which recd. */
int f_prevpri; /* pri of f_prevline */ int f_prevpri; /* pri of f_prevline */
size_t f_prevlen; /* length of f_prevline */ size_t f_prevlen; /* length of f_prevline */
int f_prevcount; /* repetition cnt of prevline */ size_t f_prevcount; /* repetition cnt of prevline */
size_t f_repeatcount; /* number of "repeated" msgs */ size_t f_repeatcount; /* number of "repeated" msgs */
int f_flags; /* store some additional flags */ int f_flags; /* store some additional flags */
int f_rotatecount; int f_rotatecount;