From 1217f279ad9a5c79d61642a49eba38a552c1ec52 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 30 Mar 1999 20:38:06 +0000 Subject: Made static. Make it use the full year format for strftime(). 1999-03-30 Federico Mena Quintero * gncal-todo.c (convert_time_t_to_char): Made static. Make it use the full year format for strftime(). svn path=/trunk/; revision=791 --- calendar/ChangeLog | 5 +++++ calendar/gncal-todo.c | 15 ++++++--------- 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 + + * gncal-todo.c (convert_time_t_to_char): Made static. Make it use + the full year format for strftime(). + 1999-03-27 Nuno Ferreira * calobj.c: Include 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]); } -- cgit v1.2.3