From: gregor herrmann Date: Wed, 18 Jun 2025 20:42:50 +0200 Subject: Use proper format strings in snprintf Bug-Debian: https://bugs.debian.org/643408 Forwarded: no Last-Update: 2021-12-23 --- Source/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/log.c b/Source/log.c index 5e95be2..5d26180 100644 --- a/Source/log.c +++ b/Source/log.c @@ -147,7 +147,7 @@ void log_entry(int fd, char *entry) { } if (repeats > 0) { - snprintf(date, 27, asctime(localtime(&last_repeat))); + snprintf(date, 27, "%s", asctime(localtime(&last_repeat))); snprintf(repeat_message, 40, "last message repeated %d time(s)\n", repeats); write(fd, date+4, strlen(date)-10); write(fd, " ", 1); @@ -155,7 +155,7 @@ void log_entry(int fd, char *entry) { repeats = 0; } - snprintf(date, 27, asctime(localtime(¤t))); + snprintf(date, 27, "%s", asctime(localtime(¤t))); write(fd, date+4, strlen(date)-10); write(fd, " ", 1); write(fd, entry, (strlen(entry) < 1023) ? strlen(entry) : 1023 );