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. --- ChangeLog | 2 ++ src/actions.c | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c1929b..ab3ede6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2001-04-15 shawn + * src/actions.c (cmd_clock): remove newline from date string. + * src/messages.h (MESSAGE_WELCOME): new define * src/manage.c (scanwins): ignore the help window 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