Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: segfault in strftime
- X-seq: zsh-users 14902
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: segfault in strftime
- Date: Fri, 26 Feb 2010 16:45:44 +0000
- In-reply-to: <20100226162130.GF13766@xxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <A73C7D9C-66C5-4BFA-8FB3-8560FE65B529@xxxxxxxxxxx> <20100226125256.GC13766@xxxxxxxxxxxxxxxxxxx> <20100226150748.GE13766@xxxxxxxxxxxxxxxxxxx> <20100226151712.05fbe555@news01> <20100226162130.GF13766@xxxxxxxxxxxxxxxxxxx>
Vincent Lefevre wrote:
> Wouldn't it be better to test only errno != 0 ?
Well, given we're setting it to 0 beforehand that seems reasonable.
Index: Src/Modules/datetime.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/datetime.c,v
retrieving revision 1.20
diff -p -u -r1.20 datetime.c
--- Src/Modules/datetime.c 26 Feb 2010 15:30:45 -0000 1.20
+++ Src/Modules/datetime.c 26 Feb 2010 16:44:08 -0000
@@ -113,7 +113,7 @@ bin_strftime(char *nam, char **argv, Opt
errno = 0;
secs = (time_t)strtoul(argv[1], &endptr, 10);
- if (secs == (time_t)ULONG_MAX && errno != 0) {
+ if (errno != 0) {
zwarnnam(nam, "%s: %e", argv[1], errno);
return 1;
} else if (*endptr != '\0') {
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author