From: Roy Marples Date: Mon, 26 Jan 2009 12:25:29 +0000 (+0000) Subject: Stop storing length in hostname. X-Git-Tag: v4.0.9~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b33cdbcc4880104cd2d570b734efd0fd3882571;p=thirdparty%2Fdhcpcd.git Stop storing length in hostname. --- diff --git a/dhcpcd.c b/dhcpcd.c index 1626e395..2c3fb828 100644 --- 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)