From e701ad14c74a29ce2dfb033b36a08706fe7aee9c Mon Sep 17 00:00:00 2001 From: Tomas Ogren Date: Mon, 15 Feb 1999 22:40:43 +0000 Subject: Made a private copy of what localtime() returns, to be able to keep the 1999-02-15 Tomas Ogren * goto.c: Made a private copy of what localtime() returns, to be able to keep the data after more calls to localtime(). svn path=/trunk/; revision=669 --- calendar/ChangeLog | 5 +++++ calendar/goto.c | 10 +++++----- calendar/gui/goto.c | 10 +++++----- 3 files changed, 15 insertions(+), 10 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 6c40222a54..89c65c2f8e 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +1999-02-15 Tomas Ogren + + * goto.c: Made a private copy of what localtime() returns, to be able + to keep the data after more calls to localtime(). + 1999-02-11 Miguel de Icaza * main.c (save_default_calendar): New function. Saves the diff --git a/calendar/goto.c b/calendar/goto.c index 0dd0a3f22e..cc86616d31 100644 --- a/calendar/goto.c +++ b/calendar/goto.c @@ -254,12 +254,12 @@ goto_dialog (GnomeCalendar *gcal) GtkWidget *hbox; GtkWidget *w; GtkWidget *days; - struct tm *tm; + struct tm tm; gnome_calendar = gcal; current_index = -1; - tm = localtime (&gnome_calendar->current_display); + memcpy(&tm, localtime (&gnome_calendar->current_display), sizeof(tm)); goto_win = gnome_dialog_new (_("Go to date"), GNOME_STOCK_BUTTON_CANCEL, @@ -282,17 +282,17 @@ goto_dialog (GnomeCalendar *gcal) * month_item to be created. */ - days = create_days (tm->tm_mday, tm->tm_mon, tm->tm_year + 1900); + days = create_days (tm.tm_mday, tm.tm_mon, tm.tm_year + 1900); /* Year */ - w = create_year (tm->tm_year + 1900); + w = create_year (tm.tm_year + 1900); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Month */ - w = create_months (tm->tm_mon); + w = create_months (tm.tm_mon); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); diff --git a/calendar/gui/goto.c b/calendar/gui/goto.c index 0dd0a3f22e..cc86616d31 100644 --- a/calendar/gui/goto.c +++ b/calendar/gui/goto.c @@ -254,12 +254,12 @@ goto_dialog (GnomeCalendar *gcal) GtkWidget *hbox; GtkWidget *w; GtkWidget *days; - struct tm *tm; + struct tm tm; gnome_calendar = gcal; current_index = -1; - tm = localtime (&gnome_calendar->current_display); + memcpy(&tm, localtime (&gnome_calendar->current_display), sizeof(tm)); goto_win = gnome_dialog_new (_("Go to date"), GNOME_STOCK_BUTTON_CANCEL, @@ -282,17 +282,17 @@ goto_dialog (GnomeCalendar *gcal) * month_item to be created. */ - days = create_days (tm->tm_mday, tm->tm_mon, tm->tm_year + 1900); + days = create_days (tm.tm_mday, tm.tm_mon, tm.tm_year + 1900); /* Year */ - w = create_year (tm->tm_year + 1900); + w = create_year (tm.tm_year + 1900); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Month */ - w = create_months (tm->tm_mon); + w = create_months (tm.tm_mon); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); -- cgit v1.2.3