Added new test, found and fixed an actual bug

This commit is contained in:
Erik Ekman
2009-09-20 08:43:49 +00:00
committed by Erik Ekman
parent a1a2e3cefe
commit 93a313b130
2 changed files with 47 additions and 25 deletions

View File

@@ -41,8 +41,12 @@ build_hostname(char *buf, size_t buflen,
b = buf;
b += strlen(buf);
/* move b back one step to see if the dot is there */
b--;
if (*b != '.')
*b++ = '.';
*++b = '.';
b++;
/* move b ahead of the string so we can copy to it */
strncpy(b, topdomain, strlen(topdomain)+1);