summaryrefslogtreecommitdiff
path: root/common/sock_any.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-05-05 22:29:52 +0000
committerStef Walter <stef@memberwebs.com>2004-05-05 22:29:52 +0000
commit72a9cafc3864e6abd6826d43982c9cbf6ab76329 (patch)
tree52c85fb94e487e88fda21611789bdf2354f24ee3 /common/sock_any.c
parent845693df0604b5890db0eb36e7f7bf9c2e2813e8 (diff)
- Fixed DNS resolution
- Quell some string warnings
Diffstat (limited to 'common/sock_any.c')
-rw-r--r--common/sock_any.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/sock_any.c b/common/sock_any.c
index f01933b..7a128f2 100644
--- a/common/sock_any.c
+++ b/common/sock_any.c
@@ -4,6 +4,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
+#include <string.h>
#include "sock_any.h"
@@ -183,11 +184,11 @@ int sock_any_pton(const char* addr, struct sockaddr_any* any, int defport)
t = NULL;
l = strlen(addr);
- if(l < 255 && isalpha(addr[0]))
+ if(l >= 255 || !isalpha(addr[0]))
break;
/* Some basic illegal character checks */
- if(strspn(addr, " /\\") != l)
+ if(strcspn(addr, " /\\") != l)
break;
strcpy(buf, addr);