summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2002-12-21 22:27:26 +0000
committertrhodes <trhodes@FreeBSD.org>2002-12-21 22:27:26 +0000
commit629bbce50c5ed38c42c10a3eeb9533d8f06b0b39 (patch)
tree71ea1de15ae9985010ceaf1d78f958fa0721fb95 /usr.sbin/newsyslog
parentd025aceb5b4ca22bb13f5c0229336bfdbd3052c8 (diff)
downloadFreeBSD-src-629bbce50c5ed38c42c10a3eeb9533d8f06b0b39.zip
FreeBSD-src-629bbce50c5ed38c42c10a3eeb9533d8f06b0b39.tar.gz
Make newsyslog(8) print the correct date when the logs are turned over.
PR: 46395 Submitted by: maxim MFC: eventually
Diffstat (limited to 'usr.sbin/newsyslog')
-rw-r--r--usr.sbin/newsyslog/newsyslog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index d9894a4..041a948 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -102,7 +102,7 @@ time_t timenow;
#define MIN_PID 5
#define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */
char hostname[MAXHOSTNAMELEN]; /* hostname */
-char *daytime; /* timenow in human readable form */
+char daytime[16]; /* timenow in human readable form */
static struct conf_entry *parse_file(char **files);
static char *sob(char *p);
@@ -238,7 +238,7 @@ PRS(int argc, char **argv)
char *p;
timenow = time((time_t *) 0);
- daytime = ctime(&timenow) + 4;
+ (void)strncpy(daytime, ctime(&timenow) + 4, 15);
daytime[15] = '\0';
/* Let's get our hostname */
OpenPOWER on IntegriCloud