r18237 - gnucash/trunk/src/gnome-utils - Use localtime_r() instead of localtime() in GNCDateEdit. From audit of r17459.
Charles Day
cedayiv at code.gnucash.org
Mon Aug 3 18:21:15 EDT 2009
Author: cedayiv
Date: 2009-08-03 18:21:15 -0400 (Mon, 03 Aug 2009)
New Revision: 18237
Trac: http://svn.gnucash.org/trac/changeset/18237
Modified:
gnucash/trunk/src/gnome-utils/gnc-date-edit.c
Log:
Use localtime_r() instead of localtime() in GNCDateEdit. From audit of r17459.
Modified: gnucash/trunk/src/gnome-utils/gnc-date-edit.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-date-edit.c 2009-08-03 15:52:02 UTC (rev 18236)
+++ gnucash/trunk/src/gnome-utils/gnc-date-edit.c 2009-08-03 22:21:15 UTC (rev 18237)
@@ -1,5 +1,5 @@
/*
- * gnc-dateedit.c -- Date editor widget
+ * gnc-date-edit.c -- Date editor widget
*
* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
* All rights reserved.
@@ -464,11 +464,8 @@
gtk_option_menu_set_menu (GTK_OPTION_MENU (gde->time_popup), menu);
time (¤t_time);
- tm_returned = localtime (¤t_time);
+ tm_returned = localtime_r (¤t_time, &mtm);
g_return_if_fail(tm_returned != NULL);
- /* The return value points to statically allocated, shared memory.
- * Copy the contents so we don't risk unexpected changes. */
- mtm = *tm_returned;
for (i = gde->lower_hour; i <= gde->upper_hour; i++){
GtkWidget *item, *submenu;
@@ -698,11 +695,8 @@
gde->initial_time = the_time;
/* Convert time_t to tm. */
- tm_returned = localtime (&the_time);
+ tm_returned = localtime_r (&the_time, &tm_to_set);
g_return_if_fail(tm_returned != NULL);
- /* The return value points to statically allocated, shared memory.
- * Copy the contents so we don't risk unexpected changes. */
- tm_to_set = *tm_returned;
gnc_date_edit_set_time_tm(gde, &tm_to_set);
}
More information about the gnucash-changes
mailing list