From caa07546f389f62a74d13ca22c59ee9dfddd0f3e Mon Sep 17 00:00:00 2001 From: ekzyis Date: Sun, 8 Jun 2025 14:05:47 +0200 Subject: [PATCH] Fix return type of gettemperature I get this error when trying to build my NixOS system with the nixos-25.05 channel: dwmstatus.c: In function 'gettemperature': dwmstatus.c:182:24: error: returning 'char *' from a function with return type 'int' makes integer from pointer without a cast [] 182 | return smprintf(""); | ^~~~~~~~~~~~ --- dwmstatus.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dwmstatus.c b/dwmstatus.c index d776007..7c520cd 100644 --- a/dwmstatus.c +++ b/dwmstatus.c @@ -172,7 +172,7 @@ getbattery(char *base) return smprintf("%.0f%%%c", ((float)remcap / (float)descap) * 100, status); } -int +char * gettemperature(char *base, char *sensor) { char *co; @@ -180,8 +180,7 @@ gettemperature(char *base, char *sensor) co = readfile(base, sensor); if (co == NULL) return smprintf(""); - return atof(co) / 1000; - // return smprintf("%02.0f°C", atof(co) / 1000); + return smprintf("%.0f°C", atof(co) / 1000); } char *