diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2020-02-14 01:58:20 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2020-02-14 01:58:20 +0100 |
commit | bfc5d42735c1660263904ec5254cccf539a0a458 (patch) | |
tree | 9bbb81b4a53941427e6f9e65ae55027d9108df8c /Src/Modules/zftp.c | |
parent | 74561cc51b8867e43cb2937ab2edfb36e2a829bf (diff) | |
parent | 643de931640e01aa246723d2038328ef33737965 (diff) | |
download | zsh-bfc5d42735c1660263904ec5254cccf539a0a458.tar.gz zsh-bfc5d42735c1660263904ec5254cccf539a0a458.zip |
Merge tag 'zsh-5.7.1-test-3' into debian
Test release: 5.7.1-test-3
Diffstat (limited to 'Src/Modules/zftp.c')
-rw-r--r-- | Src/Modules/zftp.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index 4aaa1f072..e8e239e76 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -237,7 +237,7 @@ enum { /* * We keep an fd open for communication between the main shell * and forked off bits and pieces. This allows us to know - * if something happend in a subshell: mode changed, type changed, + * if something happened in a subshell: mode changed, type changed, * connection was closed. If something too substantial happened * in a subshell --- connection opened, ZFTP_USER and ZFTP_PWD changed * --- we don't try to track it because it's too complicated. @@ -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); } } @@ -2518,7 +2512,8 @@ zftp_local(UNUSED(char *name), char **args, int flags) #ifdef OFF_T_IS_64_BIT printf("%s %s\n", output64(sz), mt); #else - DPUTS(sizeof(sz) > 4, "Shell compiled with wrong off_t size"); + DPUTS(sizeof(sz) > sizeof(long), + "Shell compiled with wrong off_t size"); printf("%ld %s\n", (long)sz, mt); #endif zsfree(mt); |