summaryrefslogtreecommitdiff
path: root/components/datetime.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/datetime.c')
-rw-r--r--components/datetime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/datetime.c b/components/datetime.c
index 0816923..713b0fb 100644
--- a/components/datetime.c
+++ b/components/datetime.c
@@ -9,8 +9,9 @@ datetime(const char *fmt)
time_t t;
t = time(NULL);
- if (strftime(buf, sizeof(buf), fmt, localtime(&t)) == 0)
+ if (!strftime(buf, sizeof(buf), fmt, localtime(&t))) {
return NULL;
+ }
return buf;
}