summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-26 19:48:07 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 05:48:45 -0400
commit5eb8e024511c68bbc9531996b8b8777bfc8b5861 (patch)
treefbe997aa008b738992e3ff757e73237c5090872e /textual.cc
parent46887bad42530c8c7d5cf7970e8c71aa4e9e9591 (diff)
downloadfork-ledger-5eb8e024511c68bbc9531996b8b8777bfc8b5861.tar.gz
fork-ledger-5eb8e024511c68bbc9531996b8b8777bfc8b5861.tar.bz2
fork-ledger-5eb8e024511c68bbc9531996b8b8777bfc8b5861.zip
Always initialize tm_isdst to -1.
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/textual.cc b/textual.cc
index abf6d48a..c24e7d8d 100644
--- a/textual.cc
+++ b/textual.cc
@@ -573,6 +573,8 @@ unsigned int textual_parser_t::parse(std::istream& in,
last_desc = n ? n : "";
struct std::tm when;
+ std::memset(&when, 0, sizeof(struct std::tm));
+ when.tm_isdst = -1;
if (strptime(date.c_str(), "%Y/%m/%d %H:%M:%S", &when)) {
time_in = std::mktime(&when);
last_account = account_stack.front()->find_account(p);
@@ -593,6 +595,8 @@ unsigned int textual_parser_t::parse(std::istream& in,
last_desc = p;
struct std::tm when;
+ std::memset(&when, 0, sizeof(struct std::tm));
+ when.tm_isdst = -1;
if (strptime(date.c_str(), "%Y/%m/%d %H:%M:%S", &when)) {
clock_out_from_timelog(std::mktime(&when), journal);
count++;
@@ -639,6 +643,8 @@ unsigned int textual_parser_t::parse(std::istream& in,
std::strcpy(&date_buffer[std::strlen(date_field) + 1], time_field);
struct std::tm when;
+ std::memset(&when, 0, sizeof(struct std::tm));
+ when.tm_isdst = -1;
if (strptime(date_buffer, "%Y/%m/%d %H:%M:%S", &when)) {
date = std::mktime(&when);
} else {