Ticket #4798: valgrind.cosmetic.patch

File valgrind.cosmetic.patch, 1004 bytes (added by Lars Immisch <lars.immisch@…>, 12 years ago)

Patch for uninitialized struct tm in strings_from_facet.hpp

  • boost/date_time/strings_from_facet.hpp

     
    5050    //grab the needed strings by using the locale to
    5151    //output each month
    5252    const charT* p_outfmt = outfmt.c_str(), *p_outfmt_end = p_outfmt + outfmt.size();
     53    tm tm_value = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
    5354    for (int m=0; m < 12; m++) {
    54       tm tm_value;
    5555      tm_value.tm_mon = m;
    5656      stringstream_type ss;
    5757      ostream_iter_type oitr(ss);
     
    103103    //grab the needed strings by using the locale to
    104104    //output each month / weekday
    105105    const charT* p_outfmt = outfmt.c_str(), *p_outfmt_end = p_outfmt + outfmt.size();
     106    tm tm_value = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
    106107    for (int i=0; i < 7; i++) {
    107       tm tm_value;
    108108      tm_value.tm_wday = i;
    109109      stringstream_type ss;
    110110      ostream_iter_type oitr(ss);