]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability fixes.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 30 Apr 2010 09:49:24 +0000 (11:49 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 30 Apr 2010 09:49:24 +0000 (11:49 +0200)
helpers/ntlm_auth/smb_lm/libntlmssp.c
helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c
helpers/url_rewrite/fake/fake.cc

index 45c16e19d054962fdb51e2172a05d6d347b38432..7301d53eb5922ba1dab2ee17d94e1543b31ab46a 100644 (file)
@@ -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];
index eb2381e417fe7e5b8ca8644eca11e48824c8a25b..89379611c922c1159ffd6db7b8fb50392bcfebf2 100644 (file)
@@ -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;
 }
index d373cc54f94762cf3a1597418a3b4bc406fa90c2..5e0ae9164fe192fb40d1123ffdf60a22018e6cb9 100644 (file)
@@ -17,6 +17,9 @@
 #if HAVE_CSTRING
 #include <cstring>
 #endif
+#if HAVE_STRING_H
+#include <string.h>
+#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();