From: Tommie Gannert Date: Sun, 14 Aug 2016 11:35:52 +0000 (+0100) Subject: Fix warnings about using a char array index on NetBSD. X-Git-Tag: 2.11~25^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=eb0b6412af16fe00ce38faa31bd50c238f4e7098;p=i3%2Fi3status Fix warnings about using a char array index on NetBSD. The isspace macro is just a table lookup. --- 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++) {