From: Roy Marples Date: Mon, 26 Jan 2009 12:23:57 +0000 (+0000) Subject: Stop storing length in hostname. X-Git-Tag: v5.0.0~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cce80be02b7ea61ff639c2a31cf07609a7fd3a4;p=thirdparty%2Fdhcpcd.git Stop storing length in hostname. --- diff --git a/if-options.c b/if-options.c index 36dd1a0d..6802cdf9 100644 --- a/if-options.c +++ b/if-options.c @@ -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)