summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/actions.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/actions.c b/src/actions.c
index 1968ae7..f65c9f4 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -706,17 +706,16 @@ cmd_quit(void *data)
void
cmd_clock (void *data)
{
+ char *msg, *tmp;
time_t timep;
-
+
timep = time(NULL);
- if(timep == ((time_t)-1))
- {
- PRINT_ERROR ("time() failed\n")
- return;
- }
+ tmp = ctime(&timep);
+ msg = xmalloc (strlen (tmp));
+ strncpy(msg, tmp, strlen (tmp) - 1); /* Remove the newline */
- /* FIXME: There's an annoying newline at the end */
- message (ctime(&timep));
+ message (msg);
+ free (msg);
}