mirror of
https://github.com/Soccera1/agg.git
synced 2026-02-04 04:03:40 +01:00
Fix input validation for time
This commit is contained in:
parent
34169274f4
commit
e756cede3a
1 changed files with 4 additions and 0 deletions
|
|
@ -85,6 +85,10 @@ int main(void) {
|
||||||
int playtime;
|
int playtime;
|
||||||
printf ("\nHow long would you like to play for? Answer in seconds.\n");
|
printf ("\nHow long would you like to play for? Answer in seconds.\n");
|
||||||
scanf ("%d", &playtime);
|
scanf ("%d", &playtime);
|
||||||
|
if (playtime < 1) {
|
||||||
|
printf ("Error! You must select at least one second.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
int number_length;
|
int number_length;
|
||||||
printf ("Please enter maximum possible number\n");
|
printf ("Please enter maximum possible number\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue