diff options
| author | Roy Marples <roy@marples.name> | 2009-01-26 12:25:29 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-01-26 12:25:29 +0000 |
| commit | 2b33cdbcc4880104cd2d570b734efd0fd3882571 (patch) | |
| tree | b2e48da92229b48f0a613b41ee2b5f270b9cd0db | |
| parent | f85bbdcf703c4947dc517cea889cb8bf170f0525 (diff) | |
| download | dhcpcd-2b33cdbcc4880104cd2d570b734efd0fd3882571.tar.xz | |
Stop storing length in hostname.
| -rw-r--r-- | dhcpcd.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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) |
