From: Roy Marples Date: Fri, 8 Aug 2008 11:31:19 +0000 (+0000) Subject: Skip the trailing . if it exists on the FQDN. X-Git-Tag: v4.0.2~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5248f6ac08646ff73a813a5599bf18acf6937faf;p=thirdparty%2Fdhcpcd.git Skip the trailing . if it exists on the FQDN. --- diff --git a/dhcp.c b/dhcp.c index 0f8a1724..6c93c791 100644 --- a/dhcp.c +++ b/dhcp.c @@ -712,8 +712,11 @@ encode_rfc1035(const char *src, uint8_t *dst, size_t len) if (*c == '\0') break; if (*c == '.') { + /* Skip the trailing . */ + if (c == src + len - 1) + break; *lp = p - lp - 1; - if (*lp == 0) + if (*lp == '\0') return p - dst; lp = p++; } else