summaryrefslogtreecommitdiff
path: root/lib/strftime.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-10-10 02:56:10 +0000
committerJim Meyering <jim@meyering.net>1996-10-10 02:56:10 +0000
commite5e9f3ee5d2776d1f2ca360da7526c02e33ade4b (patch)
tree1a60cd80fe783b275c9717e21b57c996c51a067c /lib/strftime.c
parent62ae6ccc22d480c85af931ee90776734340cfb89 (diff)
downloadcoreutils-e5e9f3ee5d2776d1f2ca360da7526c02e33ade4b.tar.xz
(strftime): Accommodate the broken C compiler
that comes with SunOS -- don't initialize aggregates in decls of automatic variables. Reported by Kaveh Ghazi.
Diffstat (limited to 'lib/strftime.c')
-rw-r--r--lib/strftime.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/strftime.c b/lib/strftime.c
index aa97c02ce..de6a0d427 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -658,8 +658,11 @@ strftime (s, maxsize, format, tp)
case 's': /* GNU extension. */
{
- struct tm ltm = *tp;
- time_t t = mktime (&ltm);
+ struct tm ltm;
+ time_t t;
+
+ ltm = *tp;
+ t = mktime (&ltm);
/* Generate string value for T using time_t arithmetic;
this works even if sizeof (long) < sizeof (time_t). */
@@ -803,8 +806,11 @@ strftime (s, maxsize, format, tp)
diff = tp->tm_gmtoff;
#else
struct tm gtm;
- struct tm ltm = *tp;
- time_t lt = mktime (&ltm);
+ struct tm ltm;
+ time_t lt;
+
+ ltm = *tp;
+ lt = mktime (&ltm);
if (lt == (time_t) -1)
{