mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 11:21:13 +02:00
44162 (tweaked): Avoid format-overflow warning in zftp.c
This commit is contained in:
parent
51d2e91a7e
commit
5ca680c93c
2 changed files with 5 additions and 8 deletions
|
@ -1,5 +1,8 @@
|
||||||
2019-03-25 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
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
|
* Wesley Schwengle: 44164: Src/params.c: Avoid stringop-truncation
|
||||||
warning by replacing strncpy() by memcpy()
|
warning by replacing strncpy() by memcpy()
|
||||||
|
|
||||||
|
|
|
@ -1257,14 +1257,8 @@ zfstats(char *fnam, int remote, off_t *retsize, char **retmdtm, int fd)
|
||||||
if (retmdtm) {
|
if (retmdtm) {
|
||||||
/* use gmtime() rather than localtime() for consistency */
|
/* use gmtime() rather than localtime() for consistency */
|
||||||
tm = gmtime(&statbuf.st_mtime);
|
tm = gmtime(&statbuf.st_mtime);
|
||||||
/*
|
/* FTP format for date is YYYYMMDDHHMMSS */
|
||||||
* FTP format for data is YYYYMMDDHHMMSS
|
ztrftime(tmbuf, sizeof(tmbuf), "%Y%m%d%H%M%S", tm, 0L);
|
||||||
* 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);
|
|
||||||
mt = ztrdup(tmbuf);
|
mt = ztrdup(tmbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue