projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bind host. Always append :0 or force :0 YAZ-795
[yaz-moved-to-github.git]
/
src
/
tcpip.c
diff --git
a/src/tcpip.c
b/src/tcpip.c
index
a14f66e
..
47655a9
100644
(file)
--- a/
src/tcpip.c
+++ b/
src/tcpip.c
@@
-261,7
+261,15
@@
COMSTACK yaz_tcpip_create2(int s, int flags, int protocol,
if (bind_host)
{
tcpip_state *sp = (tcpip_state *) p->cprivate;
if (bind_host)
{
tcpip_state *sp = (tcpip_state *) p->cprivate;
- sp->bind_host = xstrdup(bind_host);
+ char *cp;
+ sp->bind_host = xmalloc(strlen(bind_host) + 4);
+ strcpy(sp->bind_host, bind_host);
+ cp = strrchr(sp->bind_host, ':');
+
+ if (!cp || cp[1] == '\0')
+ strcat(sp->bind_host, ":0");
+ else
+ strcpy(cp, ":0");
}
if (connect_host)
{
}
if (connect_host)
{