Commit 4f8c02ec authored by Daniel Salzman's avatar Daniel Salzman

conf: remove trailing dot also from the root domain in the %s directive

parent a6d1cc1e
......@@ -773,11 +773,10 @@ static int str_char(
return KNOT_EINVAL;
}
// Remove the trailing dot if not root zone.
// Remove the trailing dot.
size_t zone_len = strlen(buff);
if (zone_len > 1) {
buff[zone_len--] = '\0';
}
assert(zone_len > 0);
buff[zone_len--] = '\0';
// Get the block length.
size_t len = index2 - index1 + 1;
......
......@@ -77,7 +77,7 @@ static void test_get_filename(void)
check_name(zone, "/%c[4]", "/");
zone = ".";
check_name(zone, "/%c[0]", "/.");
check_name(zone, "/%c[0]", "/");
check_name(zone, "/%c[1]", "/");
// Label formatter.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment