[cfe-commits] [libcxx] r161196 - /libcxx/trunk/src/locale.cpp

Howard Hinnant hhinnant at apple.com
Thu Aug 2 11:44:17 PDT 2012


Author: hhinnant
Date: Thu Aug  2 13:44:17 2012
New Revision: 161196

URL: http://llvm.org/viewvc/llvm-project?rev=161196&view=rev
Log:
Andrew Morrow: The attached patch updates the initialization of the 'struct tm' in
__time_get_storage<char> to match the initialization behavior in
__time_get_storage<wchar>. Without the initialization, valgrind
reports errors in the subsequent calls to strftime_l.

Modified:
    libcxx/trunk/src/locale.cpp

Modified: libcxx/trunk/src/locale.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=161196&r1=161195&r2=161196&view=diff
==============================================================================
--- libcxx/trunk/src/locale.cpp (original)
+++ libcxx/trunk/src/locale.cpp Thu Aug  2 13:44:17 2012
@@ -4864,7 +4864,7 @@
 void
 __time_get_storage<char>::init(const ctype<char>& ct)
 {
-    tm t;
+    tm t = {0};
     char buf[100];
     // __weeks_
     for (int i = 0; i < 7; ++i)





More information about the cfe-commits mailing list