MINOR: resolvers: fix the resolv_dn_label_to_str() API about trailing zero

This function suffers from the same API issue as its sibling that does the
opposite direction, it demands that the input string is zero-terminated
*and* that its length *including* the trailing zero is passed on input,
forcing callers to pass length + 1, and itself to use that length - 1
everywhere internally.

This patch addressess this. There is a single caller, which is the
location of the previous bug, so it should probably be backported at
least to keep the code consistent across versions. Note that the
function is called dns_dn_label_to_str() in 2.3 and earlier.

(cherry picked from commit 875ee704dd76b12e5db9ad5c9ae5f2a23b4a4a86)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/resolvers.c b/src/resolvers.c
index e288512..e7a2516 100644
--- a/src/resolvers.c
+++ b/src/resolvers.c
@@ -780,7 +780,7 @@
 					const char *msg = NULL;
 					char hostname[DNS_MAX_NAME_SIZE+1];
 
-					if (resolv_dn_label_to_str(item->target, item->data_len+1,
+					if (resolv_dn_label_to_str(item->target, item->data_len,
 					                           hostname, sizeof(hostname)) == -1) {
 						HA_SPIN_UNLOCK(SERVER_LOCK, &srv->lock);
 						continue;
@@ -1620,12 +1620,14 @@
 	return (currentip_found ? RSLV_UPD_NO : RSLV_UPD_SRVIP_NOT_FOUND);
 }
 
-/* Turns a domain name label into a string.
+/* Turns a domain name label into a string: 3www7haproxy3org into www.haproxy.org
  *
- * <dn> must be a null-terminated string. <dn_len> must include the terminating
- * null byte. <str> must be allocated and its size must be passed in <str_len>.
+ * <dn> contains the input label of <dn_len> bytes long and does not need to be
+ * null-terminated. <str> must be allocated large enough to contain a full host
+ * name plus the trailing zero, and the allocated size must be passed in
+ * <str_len>.
  *
- *  In case of error, -1 is returned, otherwise, the number of bytes copied in
+ * In case of error, -1 is returned, otherwise, the number of bytes copied in
  * <str> (including the terminating null byte).
  */
 int resolv_dn_label_to_str(const char *dn, int dn_len, char *str, int str_len)
@@ -1633,11 +1635,11 @@
 	char *ptr;
 	int i, sz;
 
-	if (str_len < dn_len - 1)
+	if (str_len < dn_len)
 		return -1;
 
 	ptr = str;
-	for (i = 0; i < dn_len-1; ++i) {
+	for (i = 0; i < dn_len; ++i) {
 		sz = dn[i];
 		if (i)
 			*ptr++ = '.';