X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/80fc20d1d69b14f36ad9bb64d8af38481cbf1ff5..5db729fedbc4b6cb8742c58ff4934afb50732974:/components/temperature.c diff --git a/components/temperature.c b/components/temperature.c index 64199f5..4e27a9d 100644 --- a/components/temperature.c +++ b/components/temperature.c @@ -9,8 +9,11 @@ { int temp; - return (pscanf(file, "%d", &temp) == 1) ? - bprintf("%d", temp / 1000) : NULL; + if(pscanf(file, "%d", &temp) != 1) { + return NULL; + } + + return bprintf("%d", temp / 1000); } #elif defined(__OpenBSD__) #include