summaryrefslogtreecommitdiff
path: root/src/htslib.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2014-04-13 18:59:36 +0000
committerXavier Roche <xroche@users.noreply.github.com>2014-04-13 18:59:36 +0000
commit21debe05da804f5e7e3dbbbe48f8448363909aea (patch)
tree674e7507843eccb9c8022fcb43c54979e23d015e /src/htslib.c
parentd0d9660ac9f83e8035cd8c03b824bd472498ba2e (diff)
const char* fixes.
Diffstat (limited to 'src/htslib.c')
-rw-r--r--src/htslib.c13
1 files changed, 6 insertions, 7 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;