aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-03-04 08:43:37 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2011-03-04 08:43:37 +0100
commit1fc9c69e438984520e650d1f30be66f38758d37b (patch)
tree848ec82e086df9859c4bb8e43617db41b8950482 /src/utils.c
parentaaa000cd5aeeba7f1862d46f777df29cca8e8fd3 (diff)
downloadcalcurse-1fc9c69e438984520e650d1f30be66f38758d37b.tar.gz
calcurse-1fc9c69e438984520e650d1f30be66f38758d37b.zip
Simplify now() and nowstr() in "utils.c".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/utils.c b/src/utils.c
index 84cbd9d..e4425f3 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -766,20 +766,16 @@ get_today (void)
long
now (void)
{
- time_t current_time;
-
- current_time = time (NULL);
- return (current_time);
+ return (long)time (NULL);
}
char *
nowstr (void)
{
static char buf[BUFSIZ];
- time_t now;
+ time_t t = now ();
- (void)time (&now);
- (void)strftime (buf, sizeof buf, "%a %b %d %T %Y", localtime (&now));
+ (void)strftime (buf, sizeof buf, "%a %b %d %T %Y", localtime (&t));
return buf;
}