summaryrefslogtreecommitdiff
path: root/components/battery.c
diff options
context:
space:
mode:
authorAaron Marcher <me@drkhsh.at>2018-07-07 11:08:26 +0200
committerAaron Marcher <me@drkhsh.at>2018-07-07 11:08:26 +0200
commitacfa1f50c24add6b9a78d94af21f9350150fb9c2 (patch)
tree2153a871d07704dcae0eec15b1d8ceab04724fbd /components/battery.c
parentc2492c3f99d9d434a6f935dea8e97fa27cdd2adc (diff)
Simplify format specifiers for uintmax_t
Diffstat (limited to 'components/battery.c')
-rw-r--r--components/battery.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/battery.c b/components/battery.c
index ae31dd6..79d16c2 100644
--- a/components/battery.c
+++ b/components/battery.c
@@ -5,8 +5,8 @@
#include "../util.h"
#if defined(__linux__)
- #include <inttypes.h>
#include <limits.h>
+ #include <stdint.h>
#include <unistd.h>
static const char *
@@ -93,7 +93,7 @@
if (!pick(bat, "/sys/class/power_supply/%s/charge_now",
"/sys/class/power_supply/%s/energy_now",
path, sizeof(path)) ||
- pscanf(path, "%" PRIuMAX, &charge_now) < 0) {
+ pscanf(path, "%ju", &charge_now) < 0) {
return NULL;
}
@@ -101,7 +101,7 @@
if (!pick(bat, "/sys/class/power_supply/%s/current_now",
"/sys/class/power_supply/%s/power_now", path,
sizeof(path)) ||
- pscanf(path, "%" PRIuMAX, &current_now) < 0) {
+ pscanf(path, "%ju", &current_now) < 0) {
return NULL;
}
@@ -113,7 +113,7 @@
h = timeleft;
m = (timeleft - (double)h) * 60;
- return bprintf("%" PRIuMAX "h %" PRIuMAX "m", h, m);
+ return bprintf("%juh %jum", h, m);
}
return "";