From 6d740d21a3ac22be454d4b85802ed314f5cc7d6a Mon Sep 17 00:00:00 2001 From: luca0N! <63941044+luca0N@users.noreply.github.com> Date: Sun, 28 Jun 2020 16:12:32 -0300 Subject: [PATCH] Added and improved exit pause --- main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index a7dd13a..efd7e98 100644 --- a/main.c +++ b/main.c @@ -32,6 +32,12 @@ #include #include +void exitPause(){ + printf(STR_EXIT_PAUSE); + fflush(stdout); + getch(); +} + void setConsoleColor(int consoleColor){ HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); WORD wColor; @@ -51,12 +57,14 @@ int printLicense(int full){ FILE* flic = fopen(PATH_LICENSE, "r"); if (flic == NULL){ printf("%s\n", STR_ERROR_LIC); + exitPause(); return -1; } char c; while ((c = fgetc(flic)) != EOF) { printf("%c", c); } + exitPause(); } } @@ -238,9 +246,7 @@ void getAdditionalDirs(bool safeMode){ printf(STR_TOTAL_DELETED_GIBIBYTES, gib); } setConsoleColor(RESET_CONSOLE_COLOR); - printf(STR_EXIT_PAUSE); - fflush(stdout); - getch(); + exitPause(); } int main(void){