added a goto if fgets fails
This commit is contained in:
@@ -166,8 +166,10 @@ char * tgetpass(prompt, timeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get the password */
|
/* get the password */
|
||||||
if (!fgets(buf, sizeof(buf), input))
|
if (!fgets(buf, sizeof(buf), input)) {
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (*(tmp = &buf[strlen(buf)-1]) == '\n')
|
if (*(tmp = &buf[strlen(buf)-1]) == '\n')
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
|
Reference in New Issue
Block a user