From 72a9cafc3864e6abd6826d43982c9cbf6ab76329 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 5 May 2004 22:29:52 +0000 Subject: - Fixed DNS resolution - Quell some string warnings --- common/sock_any.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/sock_any.c') 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 #include #include +#include #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); -- cgit v1.2.3