Skip to content
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

Fix scanf reading newline instead of input. #1

Merged
merged 2 commits into from
Oct 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions newflasher.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ static int process_sins(HANDLE dev, FILE *a, char *filename, char *outfolder, ch
printf(" WARNING WARNING WARNING!!! IGNORE OUR WARNING ONLY IN CASE YOUR BOOTLOADER IS UNLOCKED!\n");
printf(" IN CASE YOUR BOOTLOADER IS NOT UNLOCKED YOU MUST EXIT RIGHT NOW TO STOP FURTHER DAMAGE!!!\n");
printf(" Type enything and press enter for continue or type e and press enter for exit!\n");
scanf("%c", &ch);
scanf(" %c", &ch);
if (ch == 'e' || ch == 'E') {
free(tmp_reply);
printf(" You typed:%c, stopping right now...\n", ch);
Expand Down Expand Up @@ -2540,7 +2540,7 @@ int main(int argc, char *argv[])
#ifdef _WIN32
printf("\nOptional step! Type 'y' and press enter if you need GordonGate flash driver, or type 'n' to skip.\n");
printf("This creates GordonGate.7z archive in the same dir with %s!\n", progname);
scanf("%c", &ch);
scanf(" %c", &ch);
if (ch == 'y' || ch == 'Y')
{
FILE *gg = fopen("GordonGate.7z", "wb");
Expand Down Expand Up @@ -2603,7 +2603,8 @@ int main(int argc, char *argv[])
#if 1
printf("\nOptional step! Type 'y' and press ENTER if you want dump trim area, or type 'n' and press ENTER to skip.\n");
printf("Do in mind this doesn dump drm key since sake authentifiction is need for that!\n");
scanf("%c", &ch);
scanf(" %c", &ch);

if (ch == 'y' || ch == 'Y')
{
FILE *dump = NULL;
Expand Down