tAdd comment for magic number in conversion - spoon - dwm status utility (2f30 … | |
git clone git://src.adamsgaard.dk/spoon | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 311f1ed9305fbaadc78ecd85c50e3b2df87e5567 | |
parent 5334192a401aaa7ff17d0f12f46d02764ac4d11c | |
Author: sin <[email protected]> | |
Date: Wed, 2 Nov 2016 14:15:40 +0000 | |
Add comment for magic number in conversion | |
Diffstat: | |
M temp.c | 1 + | |
1 file changed, 1 insertion(+), 0 deletions(-) | |
--- | |
diff --git a/temp.c b/temp.c | |
t@@ -21,6 +21,7 @@ tempread(void *arg, char *buf, size_t len) | |
sz = sizeof(temp); | |
if (sysctl(mib, 5, &temp, &sz, NULL, 0) == -1) | |
return -1; | |
+ /* temp.value is in kelvin so convert to celsius for display */ | |
snprintf(buf, len, "%ddegC", (temp.value - 273150000) / 1000000); | |
return 0; | |
} |