summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-01-26 12:25:29 +0000
committerRoy Marples <roy@marples.name>2009-01-26 12:25:29 +0000
commit2b33cdbcc4880104cd2d570b734efd0fd3882571 (patch)
treeb2e48da92229b48f0a613b41ee2b5f270b9cd0db
parentf85bbdcf703c4947dc517cea889cb8bf170f0525 (diff)
downloaddhcpcd-2b33cdbcc4880104cd2d570b734efd0fd3882571.tar.xz
Stop storing length in hostname.
-rw-r--r--dhcpcd.c5
1 files changed, 2 insertions, 3 deletions
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)