diff --git a/src/util/files.c b/src/util/files.c index 71233c68..98c9bdc4 100644 --- a/src/util/files.c +++ b/src/util/files.c @@ -130,8 +130,7 @@ main(int argc, char *argv[]) printf("WARNING: this blasts the existing game in %s (if any)\n", gamedir); printf("continue? "); - fgets(buf, sizeof(buf), stdin); - if (*buf != 'y' && *buf != 'Y') + if (!fgets(buf, sizeof(buf), stdin) || (*buf != 'y' && *buf != 'Y')) exit(1); } for (i = 0; i < EF_MAX; i++) {