diff svr-tcpfwd.c @ 1114:db7963049308

Turn many local variables into char * reqname, bindaddr, request_addr, desthost and orighost to be exhaustive.
author Gaël PORTAY <gael.portay@gmail.com>
date Sat, 02 May 2015 23:40:30 +0200
parents c45d65392c1a
children aaf576b27a10
line wrap: on
line diff
--- a/svr-tcpfwd.c	Sat May 02 23:32:13 2015 +0200
+++ b/svr-tcpfwd.c	Sat May 02 23:40:30 2015 +0200
@@ -65,7 +65,7 @@
  * similar to the request-switching in chansession.c */
 void recv_msg_global_request_remotetcp() {
 
-	unsigned char* reqname = NULL;
+	char* reqname = NULL;
 	unsigned int namelen;
 	unsigned int wantreply = 0;
 	int ret = DROPBEAR_FAILURE;
@@ -77,7 +77,7 @@
 		goto out;
 	}
 
-	reqname = buf_getstring(ses.payload, &namelen);
+	reqname = (char *)buf_getstring(ses.payload, &namelen);
 	wantreply = buf_getbool(ses.payload);
 
 	if (namelen > MAX_NAME_LEN) {
@@ -120,7 +120,7 @@
 static int svr_cancelremotetcp() {
 
 	int ret = DROPBEAR_FAILURE;
-	unsigned char * bindaddr = NULL;
+	char * bindaddr = NULL;
 	unsigned int addrlen;
 	unsigned int port;
 	struct Listener * listener = NULL;
@@ -128,7 +128,7 @@
 
 	TRACE(("enter cancelremotetcp"))
 
-	bindaddr = buf_getstring(ses.payload, &addrlen);
+	bindaddr = (char *)buf_getstring(ses.payload, &addrlen);
 	if (addrlen > MAX_IP_LEN) {
 		TRACE(("addr len too long: %d", addrlen))
 		goto out;
@@ -155,14 +155,14 @@
 static int svr_remotetcpreq() {
 
 	int ret = DROPBEAR_FAILURE;
-	unsigned char * request_addr = NULL;
+	char * request_addr = NULL;
 	unsigned int addrlen;
 	struct TCPListener *tcpinfo = NULL;
 	unsigned int port;
 
 	TRACE(("enter remotetcpreq"))
 
-	request_addr = buf_getstring(ses.payload, &addrlen);
+	request_addr = (char *)buf_getstring(ses.payload, &addrlen);
 	if (addrlen > MAX_IP_LEN) {
 		TRACE(("addr len too long: %d", addrlen))
 		goto out;
@@ -232,9 +232,9 @@
  * address */
 static int newtcpdirect(struct Channel * channel) {
 
-	unsigned char* desthost = NULL;
+	char* desthost = NULL;
 	unsigned int destport;
-	unsigned char* orighost = NULL;
+	char* orighost = NULL;
 	unsigned int origport;
 	char portstring[NI_MAXSERV];
 	unsigned int len;
@@ -247,7 +247,7 @@
 		goto out;
 	}
 
-	desthost = buf_getstring(ses.payload, &len);
+	desthost = (char *)buf_getstring(ses.payload, &len);
 	if (len > MAX_HOST_LEN) {
 		TRACE(("leave newtcpdirect: desthost too long"))
 		goto out;
@@ -255,7 +255,7 @@
 
 	destport = buf_getint(ses.payload);
 	
-	orighost = buf_getstring(ses.payload, &len);
+	orighost = (char *)buf_getstring(ses.payload, &len);
 	if (len > MAX_HOST_LEN) {
 		TRACE(("leave newtcpdirect: orighost too long"))
 		goto out;