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
This commit is contained in:
Mark Janssen 2006-02-06 11:36:53 +00:00
parent e2b31bddcc
commit f51bdbda82
7 changed files with 13 additions and 11 deletions

View file

@ -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 */
{

View file

@ -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);

View file

@ -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 )
{

6
http.c
View file

@ -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 );

View file

@ -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 )

6
ntlm.c
View file

@ -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;

View file

@ -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 );