diff options
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 15 |
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); } |