diff options
| author | Jason King <jason.king@joyent.com> | 2021-03-19 10:25:14 -0500 |
|---|---|---|
| committer | Jason King <jason.king@joyent.com> | 2021-03-19 13:00:57 -0500 |
| commit | 1d5eda342f972d3bf9b3bec5dc9d1103beb74cb7 (patch) | |
| tree | 24ce588b8d84d57836dd50b0d1776befb0507c1f /usr/src | |
| parent | 9f79d3c392a4c8e07013da154cd979c21f168c74 (diff) | |
| download | illumos-joyent-1d5eda342f972d3bf9b3bec5dc9d1103beb74cb7.tar.gz | |
13657 atq should be better at math
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/cron/atq.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/cmd/cron/atq.c b/usr/src/cmd/cron/atq.c index 34cfb9e98e..99ce381440 100644 --- a/usr/src/cmd/cron/atq.c +++ b/usr/src/cmd/cron/atq.c @@ -2,6 +2,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright 2021 Joyent, Inc. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -372,7 +373,7 @@ printdate(char *filename) { time_t jobdate; struct tm *unpackeddate; - char date[18]; /* reformatted execution date */ + char date[19]; /* reformatted execution date */ /* * Convert the file name to a date. @@ -385,7 +386,8 @@ printdate(char *filename) /* * Format the execution date of a job. */ - sprintf(date, "%3s %2d, %4d %02d:%02d", mthnames[unpackeddate->tm_mon], + snprintf(date, sizeof (date), "%3s %2d, %4d %02d:%02d", + mthnames[unpackeddate->tm_mon], unpackeddate->tm_mday, unpackeddate->tm_year, unpackeddate->tm_hour, unpackeddate->tm_min); |
