summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-04-15 20:40:07 +0000
committersabetts <sabetts>2001-04-15 20:40:07 +0000
commit58b76fc72cd88e4a6a45b12f97810e63c75e97d6 (patch)
tree72b1258e9532f37c5f9361c99c00cc6d9175b6f2 /src
parentac84e85590a5a32c9db3979a4c05475e10d97a79 (diff)
downloadratpoison-58b76fc72cd88e4a6a45b12f97810e63c75e97d6.zip
* src/actions.c (cmd_clock): remove newline from date string.
Diffstat (limited to 'src')
-rw-r--r--src/actions.c15
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);
}