summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 d9894a4cb4e7..041a948c86e0 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 */