staticlibs / ccronexpr

Cron expression parsing in ANSI C
Apache License 2.0
150 stars 78 forks source link

isupper() and isspace() calls does not conform to some ctypes.h macro implementation #11

Closed DavidMora closed 6 years ago

DavidMora commented 6 years ago

Hello,

We are trying to use your library in an embedded system with a really strict compile environment. We noticed that in lines 491 (isupper) , 580 (isspace), 606 (isspace) you make such calls with a char subscript. However some compile options (-Werror=char-subscripts) and some libraries enforce int subscripts and will compile fail with error: array subscript has type char.

The fix is simple use an int variable for subscript or at least cast it to int like:

isspace(((int)str[i])

or

int c = str[i];
isspace(c);

Regards,

DM

staticlibs commented 6 years ago

Hi, thanks for the fix! I can merge such PR promptly, or will make this change myself next week.