summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-25 10:59:45 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-10-01 08:55:48 -0700
commit4e610d4bbcf29cca9dc5dbad29ca820996aaa8c7 (patch)
tree28b133246c81f2a2822a15a75a6d22b9559e8527
parenta74c5d915c3095059356f83d1b845192e5c472c2 (diff)
Fix warning: unused variable 'tmpport' with various configurations
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--Xtranssock.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Xtranssock.c b/Xtranssock.c
index 268c599..775a7f9 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -1433,7 +1433,6 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
char portbuf[PORTBUFSIZE];
#endif
- long tmpport;
char hostnamebuf[256]; /* tmp space */
prmsg (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
@@ -1457,7 +1456,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (is_numeric (port))
{
- tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
+ long tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
sprintf (portbuf, "%lu", tmpport);
port = portbuf;
}
@@ -1667,7 +1666,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
}
sockname.sin_port = htons (servp->s_port);
} else {
- tmpport = strtol (port, (char**)NULL, 10);
+ long tmpport = strtol (port, (char**)NULL, 10);
if (tmpport < 1024 || tmpport > USHRT_MAX)
return TRANS_CONNECT_FAILED;
sockname.sin_port = htons (((unsigned short) tmpport));