]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/auth/ntlm/fake/ntlm_fake_auth.cc
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / auth / ntlm / fake / ntlm_fake_auth.cc
index 2c3e2b80ae0d35a7ee8109955f0e97a4c3ecc833..0c43cf6e7c59b6db10a4b122ee402486cb1365f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -108,7 +108,7 @@ process_options(int argc, char *argv[])
             break;
         case 'h':
             usage();
-            exit(0);
+            exit(EXIT_SUCCESS);
         case '?':
             opt = optopt;
         /* fall thru to default */
@@ -119,7 +119,7 @@ process_options(int argc, char *argv[])
         }
     }
     if (had_error)
-        exit(1);
+        exit(EXIT_FAILURE);
 }
 
 int
@@ -155,7 +155,7 @@ main(int argc, char *argv[])
         base64_decode_init(&ctx);
         size_t dstLen = 0;
         if (buflen > 3 &&
-                base64_decode_update(&ctx, &dstLen, decodedBuf, buflen-3, reinterpret_cast<const uint8_t*>(buf+3)) &&
+                base64_decode_update(&ctx, &dstLen, decodedBuf, buflen-3, buf+3) &&
                 base64_decode_final(&ctx)) {
             decodedLen = dstLen;
             packet = (ntlmhdr*)decodedBuf;
@@ -189,8 +189,8 @@ main(int argc, char *argv[])
 
             struct base64_encode_ctx eCtx;
             base64_encode_init(&eCtx);
-            uint8_t *data = (uint8_t*)xcalloc(base64_encode_len(len), 1);
-            size_t blen = base64_encode_update(&eCtx, data, len, reinterpret_cast<uint8_t*>(&chal));
+            char *data = static_cast<char *>(xcalloc(base64_encode_len(len), 1));
+            size_t blen = base64_encode_update(&eCtx, data, len, reinterpret_cast<const uint8_t *>(&chal));
             blen += base64_encode_final(&eCtx, data+blen);
             if (NTLM_packet_debug_enabled) {
                 printf("TT %.*s\n", (int)blen, data);
@@ -220,6 +220,6 @@ main(int argc, char *argv[])
             }
         }
     }
-    exit(0);
+    return EXIT_SUCCESS;
 }