summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommie Gannert <tommie@gannert.se>2016-08-14 12:35:52 +0100
committerTommie Gannert <tommie@gannert.se>2016-08-14 12:37:38 +0100
commiteb0b6412af16fe00ce38faa31bd50c238f4e7098 (patch)
treec4c745f17954aa1f54dd8b6ec28e40e6d124b648
parenta937693cefd664b7f259713ed1fdddc4cc7ad188 (diff)
Fix warnings about using a char array index on NetBSD.
The isspace macro is just a table lookup.
-rw-r--r--src/print_battery_info.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/print_battery_info.c b/src/print_battery_info.c
index 3e97528..a97bdea 100644
--- a/src/print_battery_info.c
+++ b/src/print_battery_info.c
@@ -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++) {