Expand UTIL_requireUserConfirmation to include stdin input check

This commit is contained in:
senhuang42
2020-09-24 15:58:06 -04:00
parent 432186cbea
commit 93d63eaeb8
3 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -88,9 +88,12 @@ UTIL_STATIC void* UTIL_realloc(void *ptr, size_t size)
int g_utilDisplayLevel;
int UTIL_requireUserConfirmation(const char* prompt, const char* abortMsg,
const char* acceptableLetters) {
const char* acceptableLetters, int hasStdinInput) {
int ch, result;
if (hasStdinInput)
return 1;
UTIL_DISPLAY("%s", prompt);
ch = getchar();
result = 0;