1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-12 06:57:33 +02:00

(strftime): Accommodate the broken C compiler

that comes with SunOS -- don't initialize aggregates in decls of
automatic variables.  Reported by Kaveh Ghazi.
This commit is contained in:
Jim Meyering
1996-10-10 02:56:10 +00:00
parent 62ae6ccc22
commit e5e9f3ee5d

View File

@@ -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)
{