diff options
author | Aaron Marcher <me@drkhsh.at> | 2018-05-18 19:58:51 +0200 |
---|---|---|
committer | Aaron Marcher <me@drkhsh.at> | 2018-05-18 19:58:51 +0200 |
commit | f3178199848911c8fb51b30e3993ae47120fcc6c (patch) | |
tree | 57507d04a7cf08eba3d04fe5302c03e9b5d8040e /components/battery.c | |
parent | f170028527bdccead9a99797b45011d5e76100f1 (diff) |
Use %d instead of accidentally %i
Diffstat (limited to 'components/battery.c')
-rw-r--r-- | components/battery.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/battery.c b/components/battery.c index c7c402a..3965e8f 100644 --- a/components/battery.c +++ b/components/battery.c @@ -16,7 +16,7 @@ snprintf(path, sizeof(path), "%s%s%s", "/sys/class/power_supply/", bat, "/capacity"); - return (pscanf(path, "%i", &perc) == 1) ? bprintf("%d", perc) : NULL; + return (pscanf(path, "%d", &perc) == 1) ? bprintf("%d", perc) : NULL; } const char * @@ -62,12 +62,12 @@ if (!strcmp(state, "Discharging")) { snprintf(path, sizeof(path), "%s%s%s", "/sys/class/power_supply/", bat, "/charge_now"); - if (pscanf(path, "%i", &charge_now) != 1) { + if (pscanf(path, "%d", &charge_now) != 1) { return NULL; } snprintf(path, sizeof(path), "%s%s%s", "/sys/class/power_supply/", bat, "/current_now"); - if (pscanf(path, "%i", ¤t_now) != 1) { + if (pscanf(path, "%d", ¤t_now) != 1) { return NULL; } |