]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Stop storing length in hostname.
authorRoy Marples <roy@marples.name>
Mon, 26 Jan 2009 12:23:57 +0000 (12:23 +0000)
committerRoy Marples <roy@marples.name>
Mon, 26 Jan 2009 12:23:57 +0000 (12:23 +0000)
if-options.c

index 36dd1a0d9110ed50d4b09fbdac4f663e14272b75..6802cdf9fefefca9a5538b0ca01d69103ed525e2 100644 (file)
@@ -313,7 +313,7 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                break;
        case 'h':
                if (arg)
-                       s = parse_string(ifo->hostname + 1,
+                       s = parse_string(ifo->hostname,
                                         HOSTNAME_MAX_LEN, arg);
                else
                        s = 0;
@@ -321,11 +321,10 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                        syslog(LOG_ERR, "hostname: %m");
                        return -1;
                }
-               if (s != 0 && ifo->hostname[1] == '.') {
+               if (s != 0 && ifo->hostname[0] == '.') {
                        syslog(LOG_ERR, "hostname cannot begin with a .");
                        return -1;
                }
-               ifo->hostname[0] = (uint8_t)s;
                break;
        case 'i':
                if (arg)