ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] cleaning up cmd_clock


From: Jonathan Walther
Subject: [RP] cleaning up cmd_clock
Date: Wed, 11 Apr 2001 12:12:29 -0700 (PDT)

-----BEGIN PGP SIGNED MESSAGE-----

Now you can see the date as well as time, and all the ugly
constants are gone.  It looks a lot cleaner too.  Patch here:

Jonathan

Index: actions.c
===================================================================
RCS file: /cvsroot/ratpoison/ratpoison/src/actions.c,v
retrieving revision 1.52
diff -U3 -r1.52 actions.c
- --- actions.c 2001/04/07 05:17:34     1.52
+++ actions.c   2001/04/11 19:28:28
@@ -698,24 +698,16 @@
 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() ");
+      perror("In clock() ");
       return;
     }
- - 
- -  strncpy(msg, ctime(&timep) + 11, 8); /* FIXME: a little bit hardcoded 
looking */
- -  msg[8] = '\0';
  
- -  message (msg);
- -
- -  free(msg);
+  message (ctime(&timep));
 }
 
 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv

iQCVAwUBOtSsncK9HT/YfGeBAQFymQP/ZzSGfzMw9cMV+GS8Rjisn5PpWlZ/Ix3S
aL8OawTH9biAwk4IUjZaEjteycJdkodKubm/B8/1IHiT3kZXfgVou1KN2oJNMkPh
AIdjgN43etJidZPHhKyK9uhpTaW5G35YnvnKaIXpFdKmecxo4WewNeEJJcryGITJ
EfXkHdxtzuY=
=RhpS
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]