From f51bdbda82584d3b103715686f015c1283ff533b Mon Sep 17 00:00:00 2001 From: Mark Janssen Date: Mon, 6 Feb 2006 11:36:53 +0000 Subject: [PATCH] Fixed compiler-warnings for gcc-4... mostly type-checking git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@90 bc163920-b10d-0410-b2c5-a5491ca2ceef --- base64.c | 2 +- base64.h | 2 +- basicauth.c | 2 +- http.c | 6 ++++-- messages.c | 2 +- ntlm.c | 6 +++--- proxytunnel.c | 4 ++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/base64.c b/base64.c index 34ebf74..ac76893 100644 --- a/base64.c +++ b/base64.c @@ -88,7 +88,7 @@ void base64(unsigned char *out, const unsigned char *in, int len) *out = '\0'; } -int unbase64(char *out, const char *in, int maxlen) +int unbase64(unsigned char *out, const unsigned char *in, int maxlen) /* base 64 to raw bytes in quasi-big-endian order, returning count of bytes */ /* maxlen limits output buffer size, set to zero to ignore */ { diff --git a/base64.h b/base64.h index b265f49..37ade68 100644 --- a/base64.h +++ b/base64.h @@ -20,4 +20,4 @@ /* base64.h */ void base64(unsigned char *out, const unsigned char *in, int len); -int unbase64(char *out, const char *in, int maxlen); +int unbase64(unsigned char *out, const unsigned char *in, int maxlen); diff --git a/basicauth.c b/basicauth.c index 1ec9f46..7bc56e6 100644 --- a/basicauth.c +++ b/basicauth.c @@ -46,7 +46,7 @@ void make_basicauth() * Base64 encode the clear text cookie to create the HTTP base64 * authentication cookie */ - base64( basicauth, p, strlen( p ) ); + base64( (unsigned char *)basicauth, (unsigned char *)p, strlen( p ) ); if( args_info.verbose_flag ) { diff --git a/http.c b/http.c index c197d25..5216def 100644 --- a/http.c +++ b/http.c @@ -45,7 +45,9 @@ void analyze_HTTP() */ while (strncmp( p, "HTTP/", 5) != 0 ) { - readline(); p = strtok( buf, " "); } + readline(); + p = strtok( buf, " "); + } if (strcmp( p, "HTTP/1.0" ) != 0 && strcmp( p, "HTTP/1.1" ) != 0) { @@ -65,7 +67,7 @@ void analyze_HTTP() do { readline(); if (strncmp( buf, "Proxy-Authenticate: NTLM ", 25) == 0) { - if (parse_type2(&buf[25]) < 0) + if (parse_type2((unsigned char *)&buf[25]) < 0) exit(1); } } while ( strcmp( buf, "\r\n" ) != 0 ); diff --git a/messages.c b/messages.c index 692bcfb..c6ecc28 100644 --- a/messages.c +++ b/messages.c @@ -33,7 +33,7 @@ void message( char *s, ... ) char buf[1024]; va_start( ap, s ); - vsnprintf( buf, sizeof( buf ), s, ap ); + vsnprintf( (char *)buf, sizeof( buf ), s, ap ); va_end( ap ); if ( i_am_daemon ) diff --git a/ntlm.c b/ntlm.c index 2210a14..b2a7452 100644 --- a/ntlm.c +++ b/ntlm.c @@ -80,7 +80,7 @@ void build_type1() { type1->message_type = NTLM_TYPE_1; type1->flags = NEG_UNICODE | NEG_OEM | REQ_TARGET | NEG_NTLM | NEG_ASIGN | NEG_NTLM2 | NEG_128 | NEG_56 | IE_SETSTHIS; - base64(ntlm_type1_buf, (unsigned char *)type1, len); + base64((unsigned char *)ntlm_type1_buf, (unsigned char *)type1, len); free(type1); return; @@ -98,7 +98,7 @@ int parse_type2(unsigned char *buf) return -1; } - if (strcmp(t2->signature, "NTLMSSP") != 0) { + if (strcmp((const char *)t2->signature, "NTLMSSP") != 0) { message("parse_type2: Signature did not match\n"); return -1; } @@ -223,7 +223,7 @@ void build_type3_response() { for (i = 0; i < strlen(workstation); i++) t3[type3->workstation.offset + i * sp] = workstation[i]; - base64(ntlm_type3_buf, (unsigned char *)type3, len); + base64((unsigned char *)ntlm_type3_buf, (unsigned char *)type3, len); free(type3); return; diff --git a/proxytunnel.c b/proxytunnel.c index 1876498..00fdef2 100755 --- a/proxytunnel.c +++ b/proxytunnel.c @@ -152,7 +152,7 @@ void do_daemon() socklen_t client_len; int pid = 0; int sd_client; - char buf[80]; + char buf[80]; unsigned char addr[4]; if ( ( listen_sd = socket( AF_INET, SOCK_STREAM, 0 ) ) < 0 ) @@ -241,7 +241,7 @@ void do_daemon() } memcpy( &addr, &sa_cli.sin_addr.s_addr, 4 ); - sprintf( buf, "%u.%u.%u.%u", addr[0], addr[1], addr[2], addr[3] ); + sprintf( (char *) buf, "%u.%u.%u.%u", addr[0], addr[1], addr[2], addr[3] ); #ifdef CYGWIN message( "Started tunnel pid=%d for connection from %s", pid, buf );