]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP/MINOR: dns: dns_str_to_dn_label() only needs a const char
authorWilly Tarreau <w@1wt.eu>
Wed, 22 Jul 2015 14:42:43 +0000 (16:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Jul 2015 14:42:43 +0000 (16:42 +0200)
The string is an input, let's constify it.

include/proto/dns.h
src/dns.c

index 328298e5b14a03dae6a2882fcb957c55b0f5e700..80887e86c32260b185e8243a1fe0fad8d6872ecd 100644 (file)
@@ -25,7 +25,7 @@
 #include <types/dns.h>
 #include <types/proto_udp.h>
 
-char *dns_str_to_dn_label(char *string, char *dn, int dn_len);
+char *dns_str_to_dn_label(const char *string, char *dn, int dn_len);
 int dns_str_to_dn_label_len(const char *string);
 int dns_hostname_validation(const char *string, char **err);
 int dns_build_query(int query_id, int query_type, char *hostname_dn, int hostname_dn_len, char *buf, int bufsize);
index 3d54b95f65537e727e37b2e5ad93f92fd2b7de78..37e041cf0bd144e9fde658d261cf1b65ef04cf6b 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -928,7 +928,7 @@ int dns_build_query(int query_id, int query_type, char *hostname_dn, int hostnam
  * In the second case, memory will be allocated.
  * in case of error, -1 is returned, otherwise, number of bytes copied in dn
  */
-char *dns_str_to_dn_label(char *string, char *dn, int dn_len)
+char *dns_str_to_dn_label(const char *string, char *dn, int dn_len)
 {
        char *c, *d;
        int i, offset;