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>
snprintf (prompt, sizeof prompt, cp, user);
clear = getpass (prompt);
- if (NULL == clear) {
- static char c[1];
-
- c[0] = '\0';
- clear = c;
- }
- input = clear;
+ input = (clear == NULL) ? "" : clear;
}
/*
*/
if ((0 != retval) && ('\0' == input[0]) && use_skey) {
clear = getpass (prompt);
- if (NULL == clear) {
- static char c[1];
-
- c[0] = '\0';
- clear = c;
- }
- input = clear;
+ input = (clear == NULL) ? "" : clear;
}
if ((0 != retval) && use_skey) {