From a432f46922b7f0de1404484aee4f861c5bee6dae Mon Sep 17 00:00:00 2001 From: 0scar Date: Tue, 11 Feb 2025 10:42:43 +0100 Subject: Fix weird code in date --- status.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/status.c b/status.c index 2349547..e5e6149 100644 --- a/status.c +++ b/status.c @@ -97,10 +97,9 @@ struct interface_status interfaces[8]; void date(char* buf) { time_t now = time(NULL); - struct tm tm; - tm = *localtime(&now); + struct tm *tm = localtime(&now); - strftime(buf, ELEMENT_STRBUF_SZ, "%Y-%m-%d %H:%M", &tm); + strftime(buf, ELEMENT_STRBUF_SZ, "%Y-%m-%d %H:%M", tm); } struct battery_status -- cgit v1.3