]> git.ipfire.org Git - people/ms/dnsmasq.git/blobdiff - src/util.c
Allow hostnames to start with a number.
[people/ms/dnsmasq.git] / src / util.c
index af4031c89f6f7ef9e37036a25cca1bb9f7b15f07..94cc570ad1447a5c8490e649ad2df022d3e073b8 100644 (file)
@@ -151,14 +151,13 @@ int legal_hostname(char *name)
     /* check for legal char a-z A-Z 0-9 - _ . */
     {
       if ((c >= 'A' && c <= 'Z') ||
-         (c >= 'a' && c <= 'z'))
+         (c >= 'a' && c <= 'z') ||
+         (c >= '0' && c <= '9'))
        continue;
 
-      if (!first && 
-         ((c >= '0' && c <= '9') ||
-          c == '-' || c == '_'))
+      if (!first && (c == '-' || c == '_'))
        continue;
-
+      
       /* end of hostname part */
       if (c == '.')
        return 1;