Commit 9e3c387d authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Check return value of fgets to eliminate compiler warning

parent 604c5dca
......@@ -189,13 +189,14 @@ void TJAlienCredentialsObject::readPassword() {
tcsetattr(fileno(stdin), TCSANOW, &termnew);
char password[64];
fgets(password, sizeof(password), stdin);
if (!fgets(password, sizeof(password), stdin))
printf("\nFailed to get password input\n");
tcsetattr(0, TCSANOW, &termold);
password[strlen(password) - 1] = 0;
this->password = std::string(password);
const string TJAlienCredentialsObject::getPassword() {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment