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 /Src/Modules/datetime.c | |
| 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
Diffstat (limited to 'Src/Modules/datetime.c')
| -rw-r--r-- | Src/Modules/datetime.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |
