X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/7246dc4381c6c95454672a5c1aff65a02d6d3747..ee5ec756218c852385c5ba5ef0f75b47ba59ec39:/components/datetime.c?ds=sidebyside 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; }