]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/auth/basic/getpwnam/basic_getpwnam_auth.cc
Maintenance: Removed most NULLs using modernize-use-nullptr (#1075)
[thirdparty/squid.git] / src / auth / basic / getpwnam / basic_getpwnam_auth.cc
index 6a9164c8dc7d39030404ec1e810c7b776a6a8885..7f2dd9e02e6f2b4fa5759dd5ff1852a3c47e8a44 100644 (file)
@@ -56,7 +56,7 @@ passwd_auth(char *user, char *passwd)
 {
     struct passwd *pwd;
     pwd = getpwnam(user);
-    if (pwd == NULL) {
+    if (pwd == nullptr) {
         return 0;       /* User does not exist */
     } else {
         char *crypted = crypt(passwd, pwd->pw_passwd);
@@ -74,7 +74,7 @@ shadow_auth(char *user, char *passwd)
 {
     struct spwd *pwd;
     pwd = getspnam(user);
-    if (pwd == NULL) {
+    if (pwd == nullptr) {
         return passwd_auth(user, passwd);   /* Fall back to passwd_auth */
     } else {
         char *crypted = crypt(passwd, pwd->sp_pwdp);
@@ -94,17 +94,17 @@ main(int, char **)
     char buf[HELPER_INPUT_BUFFER];
     char *user, *passwd, *p;
 
-    setbuf(stdout, NULL);
-    while (fgets(buf, HELPER_INPUT_BUFFER, stdin) != NULL) {
+    setbuf(stdout, nullptr);
+    while (fgets(buf, HELPER_INPUT_BUFFER, stdin) != nullptr) {
 
-        if ((p = strchr(buf, '\n')) != NULL)
+        if ((p = strchr(buf, '\n')) != nullptr)
             *p = '\0';      /* strip \n */
 
-        if ((user = strtok(buf, " ")) == NULL) {
+        if ((user = strtok(buf, " ")) == nullptr) {
             SEND_ERR("No Username");
             continue;
         }
-        if ((passwd = strtok(NULL, "")) == NULL) {
+        if ((passwd = strtok(nullptr, "")) == nullptr) {
             SEND_ERR("No Password");
             continue;
         }