]> git.sur5r.net Git - i3/i3status/commitdiff
fix #1017: i3status uses generic battery instance
authorJonas Cleve <mail@jonascleve.de>
Sat, 4 May 2013 14:22:29 +0000 (16:22 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 4 May 2013 15:53:20 +0000 (17:53 +0200)
src/print_battery_info.c

index 3fc31e07b6ad66da253a14e360fa458f466e3e77..03bacdf98dde58188797b11b3f9f708f20971ef1 100644 (file)
@@ -55,11 +55,11 @@ void print_battery_info(yajl_gen json_gen, char *buffer, int number, const char
         memset(emptytimebuf, '\0', sizeof(emptytimebuf));
         memset(consumptionbuf, '\0', sizeof(consumptionbuf));
 
-        INSTANCE(path);
-
-#if defined(LINUX)
         static char batpath[512];
         sprintf(batpath, path, number);
+        INSTANCE(batpath);
+
+#if defined(LINUX)
         if (!slurp(batpath, buf, sizeof(buf))) {
                 OUTPUT_FULL_TEXT(format_down);
                 return;