diff --git a/fko/fko_common.h b/fko/fko_common.h index 7963ba77..107a1416 100644 --- a/fko/fko_common.h +++ b/fko/fko_common.h @@ -32,7 +32,6 @@ #include #include -#include #if STDC_HEADERS #include @@ -45,6 +44,13 @@ #include #endif +#if HAVE_CTYPE_H + #include /* Using this if isdigit() */ +#else + /* Fall-back does not account for locale */ + #define isdigit(c) (c >= 48 && c <= 57) +#endif + /* Convenient macros for wrapping sections in 'extern "C" {' constructs. */ #ifdef __cplusplus diff --git a/fko/fko_message.c b/fko/fko_message.c index 2cc79e0c..a53ffdf1 100644 --- a/fko/fko_message.c +++ b/fko/fko_message.c @@ -202,8 +202,11 @@ int validate_access_msg(const char *msg) */ ndx++; while(*ndx != '\0') - if(isdigit(*(ndx++)) == 0) + { + if(isdigit(*ndx) == 0) return(FKO_ERROR_INVALID_SPA_ACCESS_MSG); + ndx++; + } return(FKO_SUCCESS); }