]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/pwauth.c: Simplify empty string
authorAlejandro Colomar <alx@kernel.org>
Fri, 1 Sep 2023 23:49:00 +0000 (01:49 +0200)
committerSerge Hallyn <serge@hallyn.com>
Mon, 4 Sep 2023 13:57:18 +0000 (08:57 -0500)
commit158866bfdcaa9aea4a8e355975b9aa9200c69fce
treead5dc717c0172393ddfd0c7a215b75f49c2d6502
parentadbdd086a27f865284c954a467a4def30ca147ac
lib/pwauth.c: Simplify empty string

And do not set 'clear' to point to the empty string.  After this commit,
'clear' only stores the result of getpass(3).  This will be useful to
change the code to use agetpass().

$ grep '\<clear\>' lib/pwauth.c;
char *clear = NULL;
clear = getpass (prompt);
input = (clear == NULL) ? "" : clear;
clear = getpass (prompt);
input = (clear == NULL) ? "" : clear;
if (NULL != clear) {
strzero (clear);

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/pwauth.c