From fdcfd74823beace1efbb01202e63e033755a8308 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <calcurse@cryptocrack.de>
Date: Fri, 4 Mar 2011 10:08:02 +0100
Subject: Remove date_sec2hour_str() from "utils.c".

date_sec2hour_str() is superseded by date_sec2date_str() with "%H:%M" as
date format string, so replace all invocations and remove that function
from "utils.c".

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
---
 src/calcurse.h |  1 -
 src/day.c      |  2 +-
 src/utils.c    | 16 ----------------
 3 files changed, 1 insertion(+), 18 deletions(-)

(limited to 'src')

diff --git a/src/calcurse.h b/src/calcurse.h
index c8c6b85..5686971 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -854,7 +854,6 @@ long         get_item_time (long);
 int          get_item_hour (long);
 int          get_item_min (long);
 long         date2sec (struct date, unsigned, unsigned);
-char        *date_sec2hour_str (long);
 char        *date_sec2date_str (long, char *);
 void         date_sec2date_fmt (long, const char *, char *);
 long         date_sec_change (long, int, int);
diff --git a/src/day.c b/src/day.c
index a838d87..061b670 100644
--- a/src/day.c
+++ b/src/day.c
@@ -603,7 +603,7 @@ day_edit_time (long time)
   while (1)
     {
       status_mesg (msg_time, "");
-      timestr = date_sec2hour_str (time);
+      timestr = date_sec2date_str (time, "%H:%M");
       updatestring (win[STA].p, &timestr, 0, 1);
       if (check_time (timestr) != 1 || strlen (timestr) == 0)
 	{
diff --git a/src/utils.c b/src/utils.c
index 8988c53..ede1303 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -502,22 +502,6 @@ date2sec (struct date day, unsigned hour, unsigned min)
   return t;
 }
 
-/* Return a string containing the hour of a given date in seconds. */
-char *
-date_sec2hour_str (long sec)
-{
-  const int TIME_LEN = 6;
-  struct tm *lt;
-  time_t t;
-  char *timestr;
-
-  t = sec;
-  lt = localtime (&t);
-  timestr = (char *) mem_malloc (TIME_LEN);
-  (void)snprintf (timestr, TIME_LEN, "%02u:%02u", lt->tm_hour, lt->tm_min);
-  return timestr;
-}
-
 /* Return a string containing the date, given a date in seconds. */
 char *
 date_sec2date_str (long sec, char *datefmt)
-- 
cgit v1.2.3-70-g09d2