Skip to content

Enter password bug fixed #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yyvikash
Copy link

Bug Description and Fix
Bug:
When the user entered a password and mistakenly typed a wrong character, pressing the Backspace key (ch == 8) did not move the cursor backward and erase the character properly. Instead, the cursor remained in place, leading to incorrect password input behavior.

Fix:
The issue was resolved by adding logic to handle the Backspace key correctly. Now, when the user presses Backspace, the last character is removed from the pass array, and the cursor moves backward visually using \b \b. This ensures that users can correct their password input properly.

Fixed Code Snippet:
in password function

else if(ch == 8 && i > 0) {
printf("\b \b"); // Move cursor back, erase character, and move back again
i--; // Decrease index to remove the last entered character
}
Now, the Backspace key behaves as expected, allowing users to erase incorrect characters while entering the password.

==============================================================================

@yyvikash
Copy link
Author

Hi @ebraj 👋
I hope you're doing well! I just wanted to kindly follow up on this pull request. I fixed the password input bug and would appreciate it if you could take a look whenever you get the chance. I'm new to contributing and really excited to be a part of this project. Thanks in advance! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant