diff options
author | John Wiegley <johnw@newartisans.com> | 2012-05-15 00:22:00 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-05-15 00:22:00 -0600 |
commit | 72dd4d85bdd1f6da79dee405366311e6da96776b (patch) | |
tree | e3e0a0d6bb7bec06505965da4e845e12bbc63971 /src/times.cc | |
parent | 64a9b42381c26baf24e58b40f50f0b253e551811 (diff) | |
parent | 96172669053bbba7263a370f109f70615049a0c6 (diff) | |
download | fork-ledger-72dd4d85bdd1f6da79dee405366311e6da96776b.tar.gz fork-ledger-72dd4d85bdd1f6da79dee405366311e6da96776b.tar.bz2 fork-ledger-72dd4d85bdd1f6da79dee405366311e6da96776b.zip |
Merge branch 'release/v3.0.0-20120510'
Diffstat (limited to 'src/times.cc')
-rw-r--r-- | src/times.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/times.cc b/src/times.cc index 3c556a47..30da301f 100644 --- a/src/times.cc +++ b/src/times.cc @@ -48,7 +48,7 @@ namespace { template <typename T, typename InputFacetType, typename OutputFacetType> class temporal_io_t : public noncopyable { - const char * fmt_str; + string fmt_str; #if defined(USE_BOOST_FACETS) std::istringstream input_stream; std::ostringstream output_stream; @@ -104,7 +104,7 @@ namespace { #else // USE_BOOST_FACETS std::tm data(to_tm(when)); char buf[128]; - std::strftime(buf, 127, fmt_str, &data); + std::strftime(buf, 127, fmt_str.c_str(), &data); return buf; #endif // USE_BOOST_FACETS } @@ -138,7 +138,7 @@ namespace { #else // USE_BOOST_FACETS std::tm data; std::memset(&data, 0, sizeof(std::tm)); - if (strptime(str, fmt_str, &data)) + if (strptime(str, fmt_str.c_str(), &data)) return posix_time::ptime_from_tm(data); else return datetime_t(); @@ -175,7 +175,7 @@ namespace { std::memset(&data, 0, sizeof(std::tm)); data.tm_year = CURRENT_DATE().year() - 1900; data.tm_mday = 1; // some formats have no day - if (strptime(str, fmt_str, &data)) + if (strptime(str, fmt_str.c_str(), &data)) return gregorian::date_from_tm(data); else return date_t(); |