[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MSVC compiler support [patch 24]: strftime crash
From: |
Michael Goffioul |
Subject: |
MSVC compiler support [patch 24]: strftime crash |
Date: |
Tue, 17 Oct 2006 21:56:08 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (Windows/20060909) |
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;
- MSVC compiler support [patch 20]: opendir, readdir, ..., (continued)
- MSVC compiler support [patch 21]: glob_match ctor, Michael Goffioul, 2006/10/17
- MSVC compiler support [patch 21]: glob_match ctor, John W. Eaton, 2006/10/25
- 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 <=
- MSVC compiler support [patch 24]: strftime crash, John W. Eaton, 2006/10/25
- 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