Skip to content

Commit c6c11b9

Browse files
lib/salt.c: Compact conditionals
Signed-off-by: Alejandro Colomar <alx@kernel.org>
1 parent 7fda353 commit c6c11b9

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

lib/salt.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,7 @@ static /*@observer@*/const char *gensalt (size_t salt_size)
355355

356356
bzero(result, GENSALT_SETTING_SIZE);
357357

358-
if (NULL != meth)
359-
method = meth;
360-
else {
361-
method = getdef_str ("ENCRYPT_METHOD");
362-
if (NULL == method) {
363-
method = "SHA512";
364-
}
365-
}
358+
method = meth ?: getdef_str("ENCRYPT_METHOD") ?: "SHA512";
366359

367360
if (streq(method, "MD5")) {
368361
MAGNUM(result, '1');

0 commit comments

Comments
 (0)