diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2015-04-07 01:49:12 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2015-04-07 01:49:12 +0000 |
commit | 3ba0bf8b84ca86cfad192ea84633466ac1d28732 (patch) | |
tree | 2b61489734e479f895cfbd4251ed10c86a04e897 /lib | |
parent | 52afeb5455144d6d2f9fff364851d929b3f0d5f4 (diff) |
Add support for setting tm_zone now that we have the timezone symbol.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/time/strptime.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/time/strptime.c b/lib/libc/time/strptime.c index 35ffd57963e..8c337a2ce1e 100644 --- a/lib/libc/time/strptime.c +++ b/lib/libc/time/strptime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strptime.c,v 1.19 2015/02/09 13:32:51 tedu Exp $ */ +/* $OpenBSD: strptime.c,v 1.20 2015/04/07 01:49:11 millert Exp $ */ /* $NetBSD: strptime.c,v 1.12 1998/01/20 21:39:40 mycroft Exp $ */ /*- * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc. @@ -34,6 +34,7 @@ #include <string.h> #include <time.h> +#include "private.h" #include "tzfile.h" #define _ctloc(x) (_CurrentTimeLocale->x) @@ -99,7 +100,7 @@ _strptime(const char *buf, const char *fmt, struct tm *tm, int initialize) fields = 0; } - bp = (unsigned char *)buf; + bp = (const unsigned char *)buf; while ((c = *fmt) != '\0') { /* Clear `alternate' modifier prior to new conversion. */ alt_format = 0; @@ -487,7 +488,7 @@ literal: tm->TM_GMTOFF = -5 - i; #endif #ifdef TM_ZONE - tm->TM_ZONE = __UNCONST(nast[i]); + tm->TM_ZONE = (char *)nast[i]; #endif bp = ep; continue; @@ -499,7 +500,7 @@ literal: tm->TM_GMTOFF = -4 - i; #endif #ifdef TM_ZONE - tm->TM_ZONE = __UNCONST(nadt[i]); + tm->TM_ZONE = (char *)nadt[i]; #endif bp = ep; continue; |