Xinqi Bao's Git

Update LICENSE for Tobias
[slstatus.git] / components / load_avg.c
index d6f6bd4..5c2e252 100644 (file)
@@ -1,18 +1,18 @@
 /* See LICENSE file for copyright and license details. */
-#include <err.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "../util.h"
 
 const char *
-load_avg(const char *fmt)
+load_avg(void)
 {
        double avgs[3];
 
        if (getloadavg(avgs, 3) < 0) {
-               warnx("Failed to get the load avg");
+               warn("getloadavg: Failed to obtain load average");
                return NULL;
        }
 
-       return bprintf(fmt, avgs[0], avgs[1], avgs[2]);
+       return bprintf("%.2f %.2f %.2f", avgs[0], avgs[1], avgs[2]);
 }