]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - tools/squidclient/squidclient.cc
Maintenance: Removed most NULLs using modernize-use-nullptr (#1075)
[thirdparty/squid.git] / tools / squidclient / squidclient.cc
index 9c1d17067e08384c8a7eeaa91f0a839334667995..67e086e2b581a6581c9a464e3ef5d0011ab722d1 100644 (file)
@@ -66,7 +66,7 @@ static void set_our_signal(void);
 Parameters scParams;
 
 static int put_fd;
-static char *put_file = NULL;
+static char *put_file = nullptr;
 
 static struct stat sb;
 int total_bytes = 0;
@@ -246,9 +246,9 @@ main(int argc, char *argv[])
     time_t ims = 0;
     int max_forwards = -1;
 
-    const char *host = NULL;
+    const char *host = nullptr;
     const char *version = "1.0";
-    const char *useragent = NULL;
+    const char *useragent = nullptr;
 
     /* set the defaults */
     to_stdout = true;
@@ -267,15 +267,15 @@ main(int argc, char *argv[])
         // options for controlling squidclient
         static struct option basicOptions[] = {
             /* These are the generic options for squidclient itself */
-            {"help",    no_argument, 0, '?'},
-            {"verbose", no_argument, 0, 'v'},
-            {"quiet",   no_argument, 0, 's'},
-            {"host",    required_argument, 0, 'h'},
-            {"local",   required_argument, 0, 'l'},
-            {"port",    required_argument, 0, 'p'},
-            {"ping",    no_argument, 0, '\1'},
-            {"https",   no_argument, 0, '\3'},
-            {0, 0, 0, 0}
+            {"help",    no_argument, nullptr, '?'},
+            {"verbose", no_argument, nullptr, 'v'},
+            {"quiet",   no_argument, nullptr, 's'},
+            {"host",    required_argument, nullptr, 'h'},
+            {"local",   required_argument, nullptr, 'l'},
+            {"port",    required_argument, nullptr, 'p'},
+            {"ping",    no_argument, nullptr, '\1'},
+            {"https",   no_argument, nullptr, '\3'},
+            {nullptr, 0, nullptr, 0}
         };
 
         int c;
@@ -427,7 +427,7 @@ main(int argc, char *argv[])
     /* Build the HTTP request */
     if (strncmp(url, "mgr:", 4) == 0) {
         char *t = xstrdup(url + 4);
-        const char *at = NULL;
+        const char *at = nullptr;
         if (!strrchr(t, '@')) { // ignore any -w password if @ is explicit already.
             at = ProxyAuthorization.password;
         }
@@ -655,7 +655,7 @@ set_our_signal(void)
     sa.sa_flags = SA_RESTART;
     sigemptyset(&sa.sa_mask);
 
-    if (sigaction(SIGPIPE, &sa, NULL) < 0) {
+    if (sigaction(SIGPIPE, &sa, nullptr) < 0) {
         std::cerr << "ERROR: Cannot set PIPE signal." << std::endl;
         exit(EXIT_FAILURE);
     }