- Fixed scanf in IWAD picker without GTK

If you try to kill the program with Ctrl-C, it would run the first IWAD available in the list instead of closing it.
This commit is contained in:
Edoardo Prezioso 2014-01-17 18:57:52 +01:00
parent 2501dc6df6
commit f51fcd90b3
1 changed files with 1 additions and 2 deletions

View File

@ -684,8 +684,7 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
printf ("%d. %s (%s)\n", i+1, wads[i].Name.GetChars(), filepart);
}
printf ("Which one? ");
scanf ("%d", &i);
if (i > numwads)
if (scanf ("%d", &i) != 1 || i > numwads)
return -1;
return i-1;
}