Mercurial > hg > octave-lyh
diff liboctave/oct-time.cc @ 3344:ff13d5dec62d
[project @ 1999-11-08 04:18:48 by jwe]
author | jwe |
---|---|
date | Mon, 08 Nov 1999 04:18:48 +0000 |
parents | 8c6b4de3bdc8 |
children | 996bb7ea4507 |
line wrap: on
line diff
--- a/liboctave/oct-time.cc +++ b/liboctave/oct-time.cc @@ -47,11 +47,16 @@ #if defined (HAVE_TM_ZONE) string s = tm.zone (); - t.tm_zone = s.c_str (); + char *ps = strsave (s.c_str ()); + t.tm_zone = ps; #endif ot_unix_time = mktime (&t); +#if defined (HAVE_TM_ZONE) + delete [] ps; +#endif + ot_usec = tm.usec (); } @@ -138,7 +143,8 @@ t.tm_isdst = tm_isdst; #if defined (HAVE_TM_ZONE) - t.tm_zone = tm_zone.c_str (); + char *ps = strsave (tm_zone.c_str ()); + t.tm_zone = ps; #endif const char *fmt_str = fmt.c_str (); @@ -158,6 +164,10 @@ bufsize *= 2; } +#if defined (HAVE_TM_ZONE) + delete [] ps; +#endif + retval = buf; delete [] buf;