]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/salt.c: Compact conditionals
authorAlejandro Colomar <alx@kernel.org>
Sat, 27 Dec 2025 01:07:15 +0000 (02:07 +0100)
committerSerge Hallyn <serge@hallyn.com>
Tue, 24 Feb 2026 14:55:18 +0000 (08:55 -0600)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/salt.c

index 766e12f985a57902c10a6a12ecc7756c918a6188..83a64825b2671b131d64eda0d88690c43afaf4e0 100644 (file)
@@ -355,14 +355,7 @@ static /*@observer@*/const char *gensalt (size_t salt_size)
 
        bzero(result, GENSALT_SETTING_SIZE);
 
-       if (NULL != meth)
-               method = meth;
-       else {
-               method = getdef_str ("ENCRYPT_METHOD");
-               if (NULL == method) {
-                       method = "DES";
-               }
-       }
+       method = meth ?: getdef_str("ENCRYPT_METHOD") ?: "DES";
 
        if (streq(method, "MD5")) {
                MAGNUM(result, '1');