From: Francesco Chemolli Date: Fri, 30 Apr 2010 09:49:24 +0000 (+0200) Subject: Portability fixes. X-Git-Tag: SQUID_3_2_0_1~253 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c572fcde1b2ab7c2020751610f8cd39de9f88e3;p=thirdparty%2Fsquid.git Portability fixes. --- diff --git a/helpers/ntlm_auth/smb_lm/libntlmssp.c b/helpers/ntlm_auth/smb_lm/libntlmssp.c index 45c16e19d0..7301d53eb5 100644 --- a/helpers/ntlm_auth/smb_lm/libntlmssp.c +++ b/helpers/ntlm_auth/smb_lm/libntlmssp.c @@ -18,6 +18,7 @@ typedef unsigned char uchar; #include "ntlm_smb_lm_auth.h" #include "util.h" /* from Squid */ +#include "compat/stdvarargs.h" #include "valid.h" #include "smbencrypt.h" @@ -67,6 +68,16 @@ int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName, char *PassWord, #define debug_dump_ntlmssp_flags(X) /* empty */ #endif /* DEBUG */ +void +debug (char *format,...) +{ +#ifdef DEBUG + va_list args; + va_start(args,format); + vfprintf(stderr, format, args); + va_end(args); +#endif /* DEBUG */ +} #define ENCODED_PASS_LEN 24 static unsigned char challenge[NONCE_LEN]; diff --git a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c index eb2381e417..89379611c9 100644 --- a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c +++ b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c @@ -435,8 +435,7 @@ manage_request() SEND("BH unknown authentication packet type"); return; } - - + /* notreached */ return; } if (memcmp(buf, "YR", 2) == 0) { /* refresh-request */ @@ -494,5 +493,6 @@ main(int argc, char *argv[]) while (1) { manage_request(); } + /* notreached */ return 0; } diff --git a/helpers/url_rewrite/fake/fake.cc b/helpers/url_rewrite/fake/fake.cc index d373cc54f9..5e0ae9164f 100644 --- a/helpers/url_rewrite/fake/fake.cc +++ b/helpers/url_rewrite/fake/fake.cc @@ -17,6 +17,9 @@ #if HAVE_CSTRING #include #endif +#if HAVE_STRING_H +#include +#endif #define BUFFER_SIZE 10240 @@ -26,7 +29,7 @@ * -h interface help. */ char *my_program_name = NULL; -int debug_enabled = 0; +int print_debug_messages = 0; static void usage(void) @@ -47,7 +50,7 @@ process_options(int argc, char *argv[]) while (-1 != (opt = getopt(argc, argv, "hd"))) { switch (opt) { case 'd': - debug_enabled = 1; + print_debug_messages = 1; break; case 'h': usage();