Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85706 - trunk/boost/chrono/io
From: vicente.botet_at_[hidden]
Date: 2013-09-16 13:09:27


Author: viboes
Date: 2013-09-16 13:09:27 EDT (Mon, 16 Sep 2013)
New Revision: 85706
URL: http://svn.boost.org/trac/boost/changeset/85706

Log:
Chrono: initialize std::tm to all 0.

Text files modified:
   trunk/boost/chrono/io/time_point_io.hpp | 3 +++
   1 files changed, 3 insertions(+), 0 deletions(-)

Modified: trunk/boost/chrono/io/time_point_io.hpp
==============================================================================
--- trunk/boost/chrono/io/time_point_io.hpp Mon Sep 16 13:01:45 2013 (r85705)
+++ trunk/boost/chrono/io/time_point_io.hpp 2013-09-16 13:09:27 EDT (Mon, 16 Sep 2013) (r85706)
@@ -270,6 +270,7 @@
             case 'A':
               {
                 std::tm tm2;
+ std::memset(&tm2, 0, sizeof(std::tm));
                 that_.get_weekday(b, e, iob, err, &tm2);
                 //tm->tm_wday = tm2.tm_wday;
               }
@@ -279,6 +280,7 @@
             case 'h':
               {
                 std::tm tm2;
+ std::memset(&tm2, 0, sizeof(std::tm));
                 that_.get_monthname(b, e, iob, err, &tm2);
                 //tm->tm_mon = tm2.tm_mon;
               }
@@ -882,6 +884,7 @@
           std::locale loc = os.getloc();
           time_t t = system_clock::to_time_t(time_point_cast<system_clock::duration>(tp));
           std::tm tm;
+ std::memset(&tm, 0, sizeof(std::tm));
           if (tz == timezone::local)
           {
 #if defined BOOST_WINDOWS && ! defined(__CYGWIN__)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk