Added and improved exit pause

This commit is contained in:
luca0N! 2020-06-28 16:12:32 -03:00
parent 79b85a4b85
commit 6d740d21a3
No known key found for this signature in database
GPG Key ID: 9F1B99B522287CAB
1 changed files with 9 additions and 3 deletions

12
main.c
View File

@ -32,6 +32,12 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
void exitPause(){
printf(STR_EXIT_PAUSE);
fflush(stdout);
getch();
}
void setConsoleColor(int consoleColor){ void setConsoleColor(int consoleColor){
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
WORD wColor; WORD wColor;
@ -51,12 +57,14 @@ int printLicense(int full){
FILE* flic = fopen(PATH_LICENSE, "r"); FILE* flic = fopen(PATH_LICENSE, "r");
if (flic == NULL){ if (flic == NULL){
printf("%s\n", STR_ERROR_LIC); printf("%s\n", STR_ERROR_LIC);
exitPause();
return -1; return -1;
} }
char c; char c;
while ((c = fgetc(flic)) != EOF) { while ((c = fgetc(flic)) != EOF) {
printf("%c", c); printf("%c", c);
} }
exitPause();
} }
} }
@ -238,9 +246,7 @@ void getAdditionalDirs(bool safeMode){
printf(STR_TOTAL_DELETED_GIBIBYTES, gib); printf(STR_TOTAL_DELETED_GIBIBYTES, gib);
} }
setConsoleColor(RESET_CONSOLE_COLOR); setConsoleColor(RESET_CONSOLE_COLOR);
printf(STR_EXIT_PAUSE); exitPause();
fflush(stdout);
getch();
} }
int main(void){ int main(void){