summaryrefslogtreecommitdiffstats
path: root/dhcp.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-08-08 11:31:19 +0000
committerRoy Marples <roy@marples.name>2008-08-08 11:31:19 +0000
commit5248f6ac08646ff73a813a5599bf18acf6937faf (patch)
treec09e84400fd44a67eaf4c6f67ffc741f3f417e05 /dhcp.c
parentbe3c2740b76e1e59fa46ce0152c6c6eda1525917 (diff)
downloaddhcpcd-5248f6ac08646ff73a813a5599bf18acf6937faf.tar.xz
Skip the trailing . if it exists on the FQDN.
Diffstat (limited to 'dhcp.c')
-rw-r--r--dhcp.c5
1 files changed, 4 insertions, 1 deletions
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