]> git.meshlink.io Git - catta/blobdiff - avahi-core/domain-util.c
build docs for avahi-core only if --enable-core-docs was passed to configure. Build...
[catta] / avahi-core / domain-util.c
index f5412264c20ea3382cd4432c30739ecfef628847..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;
@@ -72,6 +75,9 @@ char *avahi_get_host_name(char *ret_s, size_t size) {
         if (*ret_s == 0)
             snprintf(ret_s, size, "unnamed");
     }
+
+    if (size >= AVAHI_LABEL_MAX)
+       ret_s[AVAHI_LABEL_MAX-1] = 0;    
     
     return ret_s;
 }