diff options
-rw-r--r-- | calendar/ChangeLog | 5 | ||||
-rw-r--r-- | calendar/gncal-todo.c | 15 | ||||
-rw-r--r-- | calendar/gui/gncal-todo.c | 15 |
3 files changed, 17 insertions, 18 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 43ebb8ab47..6f338a09b2 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx> + + * gncal-todo.c (convert_time_t_to_char): Made static. Make it use + the full year format for strftime(). + 1999-03-27 Nuno Ferreira <nmrf@rnl.ist.utl.pt> * calobj.c: Include <config.h> So that strings get translated. diff --git a/calendar/gncal-todo.c b/calendar/gncal-todo.c index 669b07e07e..e1c708384b 100644 --- a/calendar/gncal-todo.c +++ b/calendar/gncal-todo.c @@ -473,22 +473,19 @@ gncal_todo_new (GnomeCalendar *calendar) return GTK_WIDGET (todo); } - - -char * +static char * convert_time_t_to_char (time_t t) { - char *buffer; + char buf[100]; struct tm *tm; - buffer = g_malloc(15); tm = localtime (&t); - strftime(buffer, 15, "%m/%d/%y", tm); + strftime(buf, sizeof (buf), "%m/%d/%Y", tm); - return buffer; + return g_strdup (buf); } -GtkStyle * +static GtkStyle * make_overdue_todo_style(GncalTodo *todo) { GtkStyle *overdue_style = NULL; @@ -531,7 +528,7 @@ insert_in_clist (GncalTodo *todo, iCalObject *ico) */ if(ico->dtend && todo_show_due_date) { - text[1] = convert_time_t_to_char(ico->dtend); + text[1] = convert_time_t_to_char (ico->dtend); /* Append the data's pointer so later it can be properly freed */ todo->data_ptrs = g_slist_append (todo->data_ptrs, text[1]); } diff --git a/calendar/gui/gncal-todo.c b/calendar/gui/gncal-todo.c index 669b07e07e..e1c708384b 100644 --- a/calendar/gui/gncal-todo.c +++ b/calendar/gui/gncal-todo.c @@ -473,22 +473,19 @@ gncal_todo_new (GnomeCalendar *calendar) return GTK_WIDGET (todo); } - - -char * +static char * convert_time_t_to_char (time_t t) { - char *buffer; + char buf[100]; struct tm *tm; - buffer = g_malloc(15); tm = localtime (&t); - strftime(buffer, 15, "%m/%d/%y", tm); + strftime(buf, sizeof (buf), "%m/%d/%Y", tm); - return buffer; + return g_strdup (buf); } -GtkStyle * +static GtkStyle * make_overdue_todo_style(GncalTodo *todo) { GtkStyle *overdue_style = NULL; @@ -531,7 +528,7 @@ insert_in_clist (GncalTodo *todo, iCalObject *ico) */ if(ico->dtend && todo_show_due_date) { - text[1] = convert_time_t_to_char(ico->dtend); + text[1] = convert_time_t_to_char (ico->dtend); /* Append the data's pointer so later it can be properly freed */ todo->data_ptrs = g_slist_append (todo->data_ptrs, text[1]); } |