]> git.sur5r.net Git - i3/i3status/commitdiff
Fix warnings about using a char array index on NetBSD. 149/head
authorTommie Gannert <tommie@gannert.se>
Sun, 14 Aug 2016 11:35:52 +0000 (12:35 +0100)
committerTommie Gannert <tommie@gannert.se>
Sun, 14 Aug 2016 11:37:38 +0000 (12:37 +0100)
The isspace macro is just a table lookup.

src/print_battery_info.c

index 3e97528b1595f44a2863327359aac095fb5a3358..a97bdeab2183b9e86f55b5bde1c3dba1d43212ea 100644 (file)
@@ -404,14 +404,14 @@ void print_battery_info(yajl_gen json_gen, char *buffer, int number, const char
         }
     }
 
-#define EAT_SPACE_FROM_OUTPUT_IF_NO_OUTPUT()              \
-    do {                                                  \
-        if (outwalk == prevoutwalk) {                     \
-            if (outwalk > buffer && isspace(outwalk[-1])) \
-                outwalk--;                                \
-            else if (isspace(*(walk + 1)))                \
-                walk++;                                   \
-        }                                                 \
+#define EAT_SPACE_FROM_OUTPUT_IF_NO_OUTPUT()                   \
+    do {                                                       \
+        if (outwalk == prevoutwalk) {                          \
+            if (outwalk > buffer && isspace((int)outwalk[-1])) \
+                outwalk--;                                     \
+            else if (isspace((int)*(walk + 1)))                \
+                walk++;                                        \
+        }                                                      \
     } while (0)
 
     for (walk = format; *walk != '\0'; walk++) {