diff options
author | sabetts <sabetts> | 2001-04-15 20:40:07 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-04-15 20:40:07 +0000 |
commit | 58b76fc72cd88e4a6a45b12f97810e63c75e97d6 (patch) | |
tree | 72b1258e9532f37c5f9361c99c00cc6d9175b6f2 /src/actions.c | |
parent | ac84e85590a5a32c9db3979a4c05475e10d97a79 (diff) | |
download | ratpoison-58b76fc72cd88e4a6a45b12f97810e63c75e97d6.zip |
* src/actions.c (cmd_clock): remove newline from date string.
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 15 |
1 files changed, 7 insertions, 8 deletions
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); } |