summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/misc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/misc.c b/src/core/misc.c
index 19d114cce..fcbcdd6f7 100644
--- a/src/core/misc.c
+++ b/src/core/misc.c
@@ -152,10 +152,27 @@ int inet_aton ( const char *cp, struct in_addr *inp ) {
return 0;
}
+int isspace ( int c ) {
+ switch ( c ) {
+ case ' ':
+ case '\f':
+ case '\n':
+ case '\r':
+ case '\t':
+ case '\v':
+ return 1;
+ default:
+ return 0;
+ }
+}
+
unsigned long strtoul ( const char *p, char **endp, int base ) {
unsigned long ret = 0;
unsigned int charval;
+ while ( isspace ( *p ) )
+ p++;
+
if ( base == 0 ) {
base = 10;
if ( *p == '0' ) {