projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92ee756
)
Fix to work even when host name is shorter than IP number and on OS X in general...
author
Dennis Schafroth
<dennis@schafroth.com>
Wed, 24 Apr 2013 18:56:58 +0000
(20:56 +0200)
committer
Dennis Schafroth
<dennis@schafroth.com>
Wed, 24 Apr 2013 18:56:58 +0000
(20:56 +0200)
src/getaddrinfo.c
patch
|
blob
|
history
diff --git
a/src/getaddrinfo.c
b/src/getaddrinfo.c
index
ed8ff70
..
1b09ad3
100644
(file)
--- a/
src/getaddrinfo.c
+++ b/
src/getaddrinfo.c
@@
-69,7
+69,8
@@
void perform_getaddrinfo(struct work *w)
{
struct addrinfo hints, *res;
char host[512], *cp;
- const char *port = 0;
+ char portbuf[512]; // very big ports
+ char *port = 0;
int error;
hints.ai_flags = 0;
@@
-86,7
+87,8
@@
void perform_getaddrinfo(struct work *w)
if ((cp = strrchr(host, ':')))
{
*cp = '\0';
- port = cp + 1;
+ port = portbuf;
+ strncpy(port, cp + 1, sizeof(port));
}
error = getaddrinfo(host, port ? port : "210", &hints, &res);
if (error)