[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MSVC compiler support [patch 24]: strftime crash
From: |
John W. Eaton |
Subject: |
MSVC compiler support [patch 24]: strftime crash |
Date: |
Wed, 25 Oct 2006 20:37:39 -0400 |
On 17-Oct-2006, Michael Goffioul wrote:
| Avoid crash under Win32 when %T is given in the format string.
|
| Index: liboctave/oct-time.cc
| ===================================================================
| RCS file: /cvs/octave/liboctave/oct-time.cc,v
| retrieving revision 1.21
| diff -p -c -r1.21 oct-time.cc
| *** liboctave/oct-time.cc 16 Mar 2006 03:59:09 -0000 1.21
| --- liboctave/oct-time.cc 17 Oct 2006 11:07:42 -0000
| *************** octave_base_tm::strftime (const std::str
| *** 251,257 ****
| --- 251,265 ----
| t.tm_zone = ps;
| #endif
|
| + #ifndef _MSC_VER
| const char *fmt_str = fmt.c_str ();
| + #else
| + std::string fmt2 = fmt;
| + int pos = fmt2.find("%T");
| + if (pos != NPOS)
| + fmt2 = fmt2.replace(pos, 2, "");
| + const char *fmt_str = fmt2.c_str ();
| + #endif
|
| char *buf = 0;
| size_t bufsize = STRFTIME_BUF_INITIAL_SIZE;
There is a replacement version of strftime already included with
Octave that we could use instead of breaking this feature. So I think
we should add a configure check to see if %T works, and if it doesn't,
#undef HAVE_STRFTIME.
jwe
- MSVC compiler support [patch 20]: opendir, readdir, ..., (continued)
- MSVC compiler support [patch 22]: mx-op-defs additional macros, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 22]: mx-op-defs additional macros, John W. Eaton, 2006/10/26
- MSVC compiler support [patch 32]: waitpid, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 32]: waitpid, John W. Eaton, 2006/10/17
- MSVC compiler support [patch 25]: INFINITE, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 25]: INFINITE, John W. Eaton, 2006/10/25
- MSVC compiler support [patch 24]: strftime crash, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 24]: strftime crash,
John W. Eaton <=
- MSVC compiler support [patch 24]: strftime crash, John W. Eaton, 2006/10/25
- MSVC compiler support [patch 26]: MinGW code share, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 26]: MinGW code share, John W. Eaton, 2006/10/25
- MSVC compiler support [patch 27]: OCTAVE_HOME, Michael Goffioul, 2006/10/17
- Re: MSVC compiler support [patch 27]: OCTAVE_HOME, David Bateman, 2006/10/17
- Re: MSVC compiler support [patch 27]: OCTAVE_HOME, Michael Goffioul, 2006/10/17
- Re: MSVC compiler support [patch 27]: OCTAVE_HOME, Michael Goffioul, 2006/10/18
- Re: MSVC compiler support [patch 27]: OCTAVE_HOME, John W. Eaton, 2006/10/24
- MSVC compiler support [patch 28]: setvbuf crash, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 28]: setvbuf crash, John W. Eaton, 2006/10/25