diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/actions.c | 15 |
2 files changed, 9 insertions, 8 deletions
@@ -1,5 +1,7 @@ 2001-04-15 shawn <sabetts@diggin.lamenet.tmp> + * 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); } |