diff options
| author | Roy Marples <roy@marples.name> | 2009-01-26 12:23:57 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-01-26 12:23:57 +0000 |
| commit | 7cce80be02b7ea61ff639c2a31cf07609a7fd3a4 (patch) | |
| tree | 07d01566f1f5e130989a2c5669989c0fed141178 /if-options.c | |
| parent | 9d9af32de8a952e1dd93f38206acea8fb18f48c8 (diff) | |
| download | dhcpcd-7cce80be02b7ea61ff639c2a31cf07609a7fd3a4.tar.xz | |
Stop storing length in hostname.
Diffstat (limited to 'if-options.c')
| -rw-r--r-- | if-options.c | 5 |
1 files changed, 2 insertions, 3 deletions
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) |
