From: Willy Tarreau Date: Wed, 22 Jul 2015 14:42:43 +0000 (+0200) Subject: CLEANUP/MINOR: dns: dns_str_to_dn_label() only needs a const char X-Git-Tag: v1.6-dev3~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2100b491229a177ce34b7928002e10caab5b7781;p=thirdparty%2Fhaproxy.git CLEANUP/MINOR: dns: dns_str_to_dn_label() only needs a const char The string is an input, let's constify it. --- diff --git a/include/proto/dns.h b/include/proto/dns.h index 328298e5b1..80887e86c3 100644 --- a/include/proto/dns.h +++ b/include/proto/dns.h @@ -25,7 +25,7 @@ #include #include -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); diff --git a/src/dns.c b/src/dns.c index 3d54b95f65..37e041cf0b 100644 --- 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;