diff --git a/configure.ac b/configure.ac index ee525da68d6d98db74a2e8ac7dd527ac522e1693..e85ee0a922b2a1ad3393bceee8df1d315a0e293a 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,7 @@ AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC -AC_CHECK_FUNCS([atoi close connect execv exit _exit fclose fcntl fflush fopen forkpty fprintf fputs free freeaddrinfo freeifaddrs freopen fwrite getaddrinfo getchar getenv getopt_long htons index inet_addr inet_ntoa isatty malloc memcpy memmem memmove memset ntohs open openlog pclose popen printf pthread_cancel pthread_cond_init pthread_cond_signal pthread_cond_wait pthread_join pthread_mutexattr_init pthread_mutex_destroy pthread_mutex_init pthread_mutex_lock pthread_mutex_unlock pthread_sigmask puts read realloc rewind select setenv sigaddset sigemptyset signal snprintf socket sprintf strcasestr strcat strchr strcmp strcpy strdup strerror strlen strncasecmp strncat strncpy strsignal strstr strtok strtok_r strtol syslog system tcsetattr usleep vprintf vsnprintf vsyslog write], [], AC_MSG_ERROR([Required function not present])) +AC_CHECK_FUNCS([atoi close connect execv exit _exit fclose fcntl fflush fopen forkpty fprintf fputs free freeaddrinfo freeifaddrs freopen fwrite getaddrinfo getchar getenv getopt_long htons index inet_addr inet_ntoa isatty isdigit isspace malloc memcpy memmem memmove memset ntohs open openlog pclose popen printf pthread_cancel pthread_cond_init pthread_cond_signal pthread_cond_wait pthread_join pthread_mutexattr_init pthread_mutex_destroy pthread_mutex_init pthread_mutex_lock pthread_mutex_unlock pthread_sigmask puts read realloc rewind select setenv sigaddset sigemptyset signal snprintf socket sprintf strcasestr strcat strchr strcmp strcpy strdup strerror strlen strncasecmp strncat strncpy strsignal strstr strtok strtok_r strtol syslog system tcsetattr usleep vprintf vsnprintf vsyslog write], [], AC_MSG_ERROR([Required function not present])) AC_CHECK_FUNCS([pthread_mutexattr_setrobust]) # Use PKG_CHECK_MODULES compiler/linker flags save_openssl_CPPFLAGS="${CPPFLAGS}" diff --git a/src/config.c b/src/config.c index e6a40e7a3d353cf8cd6de81d8d10c8a7c5300961..61d15f1707c46748aff6185d20ee048c6cf80260 100644 --- a/src/config.c +++ b/src/config.c @@ -135,19 +135,19 @@ int load_config(struct vpn_config *cfg, const char *filename) val = equals + 1; // Remove heading spaces - while (iswhitespace_like(key[0])) + while (isspace(key[0])) key++; - while (iswhitespace_like(val[0])) + while (isspace(val[0])) val++; // Remove trailing spaces for (i = strlen(key) - 1; i > 0; i--) { - if (iswhitespace_like(key[i])) + if (isspace(key[i])) key[i] = '\0'; else break; } for (i = strlen(val) - 1; i > 0; i--) { - if (iswhitespace_like(val[i])) + if (isspace(val[i])) val[i] = '\0'; else break; diff --git a/src/config.h b/src/config.h index ab0eedb7fc6c4bb250ad69504e5e80918183475a..b0fae8336b5ee965f4f13db6ff0bb0caa17d6b74 100644 --- a/src/config.h +++ b/src/config.h @@ -91,10 +91,4 @@ int strtob(const char *str); int load_config(struct vpn_config *cfg, const char *filename); -inline int iswhitespace_like(const char character) -{ - return (character != '\0' \ - && (character == ' ' || character == '\t' || character == '\r')); -} - #endif