Bug 784776 - Provide a pointer as an argument to time(). r=smontagu
authorJan Beich <jbeich@tormail.org>
Sun, 26 Aug 2012 08:57:40 -0400
changeset 105512 77cd258827fd3210898afd6d722581dcb1800f17
parent 105511 b5078f2a37dd972c6f9acce6d742300391946c2c
child 105513 7dd78bf25baae3bc8fe9df9f993f03ccbe2d9111
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewerssmontagu
bugs784776
milestone17.0a1
Bug 784776 - Provide a pointer as an argument to time(). r=smontagu
intl/locale/src/unix/nsDateTimeFormatUnix.cpp
--- a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp
+++ b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp
@@ -95,17 +95,17 @@ nsresult nsDateTimeFormatUnix::Initializ
 
 void nsDateTimeFormatUnix::LocalePreferred24hour()
 {
   char str[100];
   time_t tt;
   struct tm *tmc;
   int i;
 
-  tt = time((time_t)0);
+  tt = time(nullptr);
   tmc = localtime(&tt);
 
   tmc->tm_hour=22;    // put the test sample hour to 22:00 which is 10PM
   tmc->tm_min=0;      // set the min & sec other number than '2'
   tmc->tm_sec=0;
 
   char *temp = setlocale(LC_TIME, mPlatformLocale.get());
   strftime(str, (size_t)99, "%X", (struct tm *)tmc);