diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index def35606a..b078e6507 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -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; }