}
-gchar*
+const gchar*
modest_text_utils_get_display_date (time_t date)
{
time_t now;
- static const guint BUF_SIZE = 64;
+#define DATE_BUF_SIZE 64
static const guint ONE_DAY = 24 * 60 * 60; /* seconds in one day */
- gchar date_buf[BUF_SIZE];
- gchar today_buf [BUF_SIZE];
+ static gchar date_buf[DATE_BUF_SIZE];
+
+ gchar today_buf [DATE_BUF_SIZE];
- modest_text_utils_strftime (date_buf, BUF_SIZE, "%x", date);
+ modest_text_utils_strftime (date_buf, DATE_BUF_SIZE, "%x", date);
now = time (NULL);
/* it's within the last 24 hours, but double check */
/* use the localized dates */
- modest_text_utils_strftime (today_buf, BUF_SIZE, "%x", now);
+ modest_text_utils_strftime (today_buf, DATE_BUF_SIZE, "%x", now);
/* if it's today, use the time instead */
if (strcmp (date_buf, today_buf) == 0)
- modest_text_utils_strftime (date_buf, BUF_SIZE, "%X", date);
+ modest_text_utils_strftime (date_buf, DATE_BUF_SIZE, "%X", date);
}
- return g_strdup(date_buf);
+ return date_buf;
}
+
gboolean
modest_text_utils_validate_folder_name (const gchar *folder_name)
{