From 58b76fc72cd88e4a6a45b12f97810e63c75e97d6 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sun, 15 Apr 2001 20:40:07 +0000 Subject: * src/actions.c (cmd_clock): remove newline from date string. --- src/actions.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/actions.c') 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); } -- cgit v1.2.3