Skip to content

Commit d5a6502

Browse files
lib/salt.c: gensalt(): Use STRTCPY() instead of its pattern
Signed-off-by: Alejandro Colomar <[email protected]>
1 parent 34bbd68 commit d5a6502

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/salt.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,8 @@ static /*@observer@*/const char *gensalt (size_t salt_size)
443443

444444
return retval;
445445
#else /* USE_XCRYPT_GENSALT */
446-
/* Check if the result buffer is long enough. */
447-
assert (GENSALT_SETTING_SIZE > strlen (result) + salt_len);
448446

449-
/* Concatenate a pseudo random salt. */
450-
strncat (result, gensalt (salt_len),
451-
GENSALT_SETTING_SIZE - strlen (result) - 1);
447+
assert(STRTCAT(result, gensalt(salt_len)) != -1);
452448

453449
return result;
454450
#endif /* USE_XCRYPT_GENSALT */

0 commit comments

Comments
 (0)