diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/actions.c | 18 |
2 files changed, 9 insertions, 12 deletions
@@ -1,5 +1,8 @@ 2001-04-13 shawn <sabetts@diggin.lamenet.tmp> + * 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 <cosis@lysator.liu.se> for the patch. */ +/* Show the current time on the bar. Thanks to Martin Samuelsson + <cosis@lysator.liu.se> for the patch. Thanks to Jonathan Walther + <djw@lineo.com> 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)); } |