Fix warnings about using a char array index on NetBSD.

The isspace macro is just a table lookup.
This commit is contained in:
Tommie Gannert 2016-08-14 12:35:52 +01:00
parent a937693cef
commit eb0b6412af

View 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() \ #define EAT_SPACE_FROM_OUTPUT_IF_NO_OUTPUT() \
do { \ do { \
if (outwalk == prevoutwalk) { \ if (outwalk == prevoutwalk) { \
if (outwalk > buffer && isspace(outwalk[-1])) \ if (outwalk > buffer && isspace((int)outwalk[-1])) \
outwalk--; \ outwalk--; \
else if (isspace(*(walk + 1))) \ else if (isspace((int)*(walk + 1))) \
walk++; \ walk++; \
} \ } \
} while (0) } while (0)
for (walk = format; *walk != '\0'; walk++) { for (walk = format; *walk != '\0'; walk++) {