tdate: don't use argument for time(2) as a call can fail - spoon - dwm status utility (2f30 fork)
(HTM) git clone git://src.adamsgaard.dk/spoon
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 12a65a4514d03ab4c597cd6557558981c36a0d15
(DIR) parent bd6425ea89b3da5f3f9da693110db6e891b3c474
(HTM) Author: Svyatoslav Mishyn <juef@openmailbox.org>
Date: Mon, 23 Oct 2017 23:42:23 +0300
date: don't use argument for time(2) as a call can fail
see BUGS section: http://man7.org/linux/man-pages/man2/time.2.html#BUGS
Diffstat:
M date.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/date.c b/date.c
t@@ -9,7 +9,7 @@ dateread(void *arg, char *buf, size_t len)
struct tm *now;
time_t t;
- time(&t);
+ t = time(NULL);
now = localtime(&t);
if (now == NULL)
return -1;