]> git.meshlink.io Git - catta/blobdiff - avahi-core/domain-util.c
strip characters that are not in the set [a-zA-Z0-9-] from the local host name before...
[catta] / 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;