aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2015-09-29 22:03:24 +0300
committerSergey Poznyakoff <gray@gnu.org>2015-09-29 22:03:24 +0300
commit3fcf9ee5980319e25fa8d225ea3d46f67f503d5f (patch)
tree51d1fabed27a6c8f8d1055074a1f89a6bedbbae6
parentb23232fd086284a05de68fc5cf9c40d8557aad3c (diff)
downloaddico-3fcf9ee5980319e25fa8d225ea3d46f67f503d5f.tar.gz
dico-3fcf9ee5980319e25fa8d225ea3d46f67f503d5f.tar.bz2
Fix default port in dico client
* dico/connect.c (dict_connect): Select default port if url->port is not set.
-rw-r--r--dico/connect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dico/connect.c b/dico/connect.c
index 6362dd8..b77cdc6 100644
--- a/dico/connect.c
+++ b/dico/connect.c
@@ -278,5 +278,5 @@ dict_connect(struct dict_connection **pconn, dico_url_t url)
struct dict_connection *conn;
+ char const *port = url->port ? url->port : DICO_DICT_PORT_STR;
- XDICO_DEBUG_F2(1, _("Connecting to %s:%s\n"), url->host,
- url->port ? url->port : DICO_DICT_PORT_STR);
+ XDICO_DEBUG_F2(1, _("Connecting to %s:%s\n"), url->host, port);
@@ -312,3 +312,3 @@ dict_connect(struct dict_connection **pconn, dico_url_t url)
hints.ai_socktype = SOCK_STREAM;
- rc = getaddrinfo(url->host, url->port, &hints, &res);
+ rc = getaddrinfo(url->host, port, &hints, &res);
for (rp = res; rp; rp = rp->ai_next) {

Return to:

Send suggestions and report system problems to the System administrator.