]> git.meshlink.io Git - catta/commitdiff
strip characters that are not in the set [a-zA-Z0-9-] from the local host name before...
authorLennart Poettering <lennart@poettering.net>
Mon, 24 Apr 2006 00:32:27 +0000 (00:32 +0000)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Apr 2006 00:32:27 +0000 (00:32 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1194 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/domain-util.c

index ab1ec8d0c51dd92100d8f5fb211c512b7c2d9a16..3aeba1254b2f97664780cee857eebcc6a5d47d56 100644 (file)
@@ -42,7 +42,10 @@ static void strip_bad_chars(char *s) {
     s[strcspn(s, ".")] = 0;
     
     for (p = s, d = s; *p; p++) 
-        if (isalnum(*p) || *p == '-')
+        if ((*p >= 'a' && *p <= 'z') ||
+            (*p >= 'A' && *p <= 'Z') ||
+            (*p >= '0' && *p <= '9') ||
+            *p == '-')
             *(d++) = *p;
 
     *d = 0;