summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/htslib.c13
-rw-r--r--src/htslib.h6
2 files changed, 9 insertions, 10 deletions
diff --git a/src/htslib.c b/src/htslib.c
index e3be90f..8067560 100644
--- a/src/htslib.c
+++ b/src/htslib.c
@@ -4606,7 +4606,8 @@ static t_hostent *hts_ghbn(const t_dnscache *cache, const char *const iadr, t_ho
return NULL;
}
-HTSEXT_API t_hostent *vxgethostbyname2(char *hostname, void *v_buffer, const char **error) {
+HTSEXT_API t_hostent *vxgethostbyname2(const char *hostname, void *v_buffer, const char **error) {
+ char BIGSTK tempo[HTS_URLMAXSIZE * 2];
t_fullhostent *buffer = (t_fullhostent *) v_buffer;
/* Clear */
@@ -4622,11 +4623,9 @@ HTSEXT_API t_hostent *vxgethostbyname2(char *hostname, void *v_buffer, const cha
The resolver doesn't seem to handle IP6 addresses in brackets
*/
if ((hostname[0] == '[') && (hostname[strlen(hostname) - 1] == ']')) {
- char BIGSTK tempo[HTS_URLMAXSIZE * 2];
-
tempo[0] = '\0';
strncatbuff(tempo, hostname + 1, strlen(hostname) - 2);
- strcpybuff(hostname, tempo);
+ hostname = tempo;
}
{
@@ -4689,11 +4688,11 @@ HTSEXT_API t_hostent *vxgethostbyname2(char *hostname, void *v_buffer, const cha
return NULL;
}
-HTSEXT_API t_hostent *vxgethostbyname(char *hostname, void *v_buffer) {
+HTSEXT_API t_hostent *vxgethostbyname(const char *hostname, void *v_buffer) {
return vxgethostbyname2(hostname, v_buffer, NULL);
}
-HTSEXT_API int check_hostname_dns(char *hostname) {
+HTSEXT_API int check_hostname_dns(const char *hostname) {
t_fullhostent buffer;
return vxgethostbyname(hostname, &buffer) != NULL;
}
@@ -4791,7 +4790,7 @@ t_hostent *hts_gethostbyname(httrackp * opt, const char *_iadr, void *v_buffer)
}
#else
-static HTS_INLINE t_hostent *hts_gethostbyname(httrackp * opt, char *iadr,
+static HTS_INLINE t_hostent *hts_gethostbyname(httrackp * opt, const char *iadr,
t_fullhostent * buffer) {
t_hostent *retour;
diff --git a/src/htslib.h b/src/htslib.h
index 553a49d..937e912 100644
--- a/src/htslib.h
+++ b/src/htslib.h
@@ -293,9 +293,9 @@ HTS_INLINE t_hostent *hts_gethostbyname2(httrackp * opt, const char *iadr,
HTS_INLINE t_hostent *hts_gethostbyname(httrackp * opt, const char *iadr,
void *v_buffer);
#ifndef HTTRACK_DEFLIB
-HTSEXT_API t_hostent *vxgethostbyname2(char *hostname, void *v_buffer, const char **error);
-HTSEXT_API t_hostent *vxgethostbyname(char *hostname, void *v_buffer);
-HTSEXT_API int check_hostname_dns(char *hostname);
+HTSEXT_API t_hostent *vxgethostbyname2(const char *hostname, void *v_buffer, const char **error);
+HTSEXT_API t_hostent *vxgethostbyname(const char *hostname, void *v_buffer);
+HTSEXT_API int check_hostname_dns(const char *hostname);
#endif
int ftp_available(void);