From: Roy Marples Date: Tue, 5 Aug 2008 22:06:11 +0000 (+0000) Subject: Use correct hostname length. X-Git-Tag: v4.0.2~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ca9152f440cf5808351d7ee2d11c1f8e2fc5bb9;p=thirdparty%2Fdhcpcd.git Use correct hostname length. --- diff --git a/dhcpcd.c b/dhcpcd.c index 85e99d22..4a4a73fe 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -854,9 +854,11 @@ main(int argc, char **argv) } } - if ((p = strchr(options->hostname, '.'))) { - if (options->fqdn == FQDN_DISABLE) + if ((p = strchr(options->hostname + 1, '.'))) { + if (options->fqdn == FQDN_DISABLE) { *p = '\0'; + options->hostname[0] = strlen(options->hostname + 1); + } } else { if (options->fqdn != FQDN_DISABLE) { logger(LOG_WARNING, "hostname `%s' is not a FQDN",