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

index 1626e3953661f7b4de5e6d8a7eb80a68acab8243..2c3fb82840b3ca5a11c4f888780b94b1ff17b3c7 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -316,7 +316,7 @@ parse_option(int opt, char *oarg, struct options *options)
                break;
        case 'h':
                if (oarg)
-                       s = parse_string(options->hostname + 1,
+                       s = parse_string(options->hostname,
                                         HOSTNAME_MAX_LEN, oarg);
                else
                        s = 0;
@@ -324,11 +324,10 @@ parse_option(int opt, char *oarg, struct options *options)
                        logger(LOG_ERR, "hostname: %s", strerror(errno));
                        return -1;
                }
-               if (s != 0 && options->hostname[1] == '.') {
+               if (s != 0 && options->hostname[0] == '.') {
                        logger(LOG_ERR, "hostname cannot begin with a .");
                        return -1;
                }
-               options->hostname[0] = (uint8_t)s;
                break;
        case 'i':
                if (oarg)