summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/zftp.c10
2 files changed, 5 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 93f0f9373..a78102ac1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2019-03-25 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+ * Wesley Schwengle: 44162 (tweaked): Src/Modules/zftp.c: Avoid
+ format-overflow warning by using ztrftime()
+
* Wesley Schwengle: 44164: Src/params.c: Avoid stringop-truncation
warning by replacing strncpy() by memcpy()
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);
}
}