From 58214c0d8b72ade928ce491da191af70d789e83b Mon Sep 17 00:00:00 2001 From: sabetts Date: Fri, 13 Apr 2001 09:24:05 +0000 Subject: * src/actions.c (cmd_clock): doesn't allocate memory. displays the date. --- ChangeLog | 3 +++ src/actions.c | 18 ++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 830f781..f11be06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-04-13 shawn + * src/actions.c (cmd_clock): doesn't allocate memory. displays the + date. + * src/split.h (blank_frame): new prototype * src/split.c (split_frame): calls unhide_window after maximizing diff --git a/src/actions.c b/src/actions.c index 097991b..e77f632 100644 --- a/src/actions.c +++ b/src/actions.c @@ -699,29 +699,23 @@ cmd_newwm(void *data) /* exit (EXIT_SUCCESS); */ /* } */ -/* Show the current time on the bar. Thanks to - Martin Samuelsson for the patch. */ +/* Show the current time on the bar. Thanks to Martin Samuelsson + for the patch. Thanks to Jonathan Walther + for making it pretty. */ void cmd_clock (void *data) { - char *msg; time_t timep; - msg = xmalloc (9); - timep = time(NULL); if(timep == ((time_t)-1)) { - perror("In show_clock() "); + PRINT_ERROR ("time() failed\n") return; } - - strncpy(msg, ctime(&timep) + 11, 8); /* FIXME: a little bit hardcoded looking */ - msg[8] = '\0'; - - message (msg); - free(msg); + /* FIXME: There's an annoying newline at the end */ + message (ctime(&timep)); } -- cgit v1.2.3