From 5ca680c93cb28c6616cc8f82db80a2425685dc38 Mon Sep 17 00:00:00 2001 From: Wesley Schwengle Date: Mon, 25 Mar 2019 23:01:43 +0900 Subject: 44162 (tweaked): Avoid format-overflow warning in zftp.c --- Src/Modules/zftp.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'Src/Modules') diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index 4aaa1f072..adf35b69e 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -1257,14 +1257,8 @@ zfstats(char *fnam, int remote, off_t *retsize, char **retmdtm, int fd) if (retmdtm) { /* use gmtime() rather than localtime() for consistency */ tm = gmtime(&statbuf.st_mtime); - /* - * FTP format for data is YYYYMMDDHHMMSS - * Using tm directly is easier than worrying about - * incompatible strftime()'s. - */ - sprintf(tmbuf, "%04d%02d%02d%02d%02d%02d", - tm->tm_year + 1900, tm->tm_mon+1, tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec); + /* FTP format for date is YYYYMMDDHHMMSS */ + ztrftime(tmbuf, sizeof(tmbuf), "%Y%m%d%H%M%S", tm, 0L); mt = ztrdup(tmbuf); } } -- cgit 1.4.1