diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2010-02-26 14:24:57 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-02-26 14:24:57 +0000 |
| commit | e8c1e2ff4ca3db7f03413958fd56b5d0783714c7 (patch) | |
| tree | 51347c26d10424192371a5f15468a669b52797fa | |
| parent | 27756: add OS file locking to calendar (diff) | |
| download | zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.tar zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.tar.gz zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.tar.bz2 zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.tar.lz zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.tar.xz zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.tar.zst zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.zip | |
users/14897: extra test in strftime builtin for time conversion
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | Src/Modules/datetime.c | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2010-02-26 Peter Stephenson <pws@csr.com> + * users/14897: Src/Modules/datetime.c: test needed on + conversion of time_t to struct tm. Found on 64-bit Linux. + * 27756: Doc/Zsh/calsys.yo, Functions/Calendar/calendar, Functions/Calendar/calendar_add, Functions/Calendar/calendar_edit, Functions/Calendar/calendar_sort, Src/Modules/system.c: @@ -12835,5 +12838,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4917 $ +* $Revision: 1.4918 $ ***************************************************** diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c index 328870eba..f1c5488ea 100644 --- a/Src/Modules/datetime.c +++ b/Src/Modules/datetime.c @@ -121,6 +121,10 @@ bin_strftime(char *nam, char **argv, Options ops, UNUSED(int func)) } t = localtime(&secs); + if (!t) { + zwarnnam(nam, "%s: unable to convert to time", argv[1]); + return 1; + } bufsize = strlen(argv[0]) * 8; buffer = zalloc(bufsize); |
