Skip to content

Commit 16c0ff9

Browse files
committed
refactor DEV7Launcher
1 parent fa34220 commit 16c0ff9

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

tools/DEV7Launcher/DEV7Launcher.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,14 @@ int showMSGDef() {
101101
}
102102

103103
int modifyMDODbg() {
104-
char mdo_dbg[8] = "MDO.DBG";
105-
106-
if (!fileExists(mdo_dbg)) {
107-
fprintf(stderr, "Error: %s not found \n", mdo_dbg);
104+
if (!fileExists("MDO.DBG")) {
105+
fprintf(stderr, "Error: MDO.DBG not found.\n");
108106
TaskExecution::pressEnterToExit();
109107
return 1;
110108
}
111109

112110
#ifdef _WIN32
113-
int mdoDBG = system("notepad MDO.DBG");
111+
system("notepad MDO.DBG") >= 0;
114112
#else
115113
execlp("nano", "nano", "MDO.DBG", NULL);
116114
return 1;
@@ -119,7 +117,7 @@ int modifyMDODbg() {
119117

120118
int showTraceTXT() {
121119
if (!fileExists("Trace.txt")) {
122-
fprintf(stderr, "Error: This directory does not contain an Debug log in the directory.\n");
120+
fprintf(stderr, "Error: This directory does not contain an Trace.txt.\n");
123121
TaskExecution::pressEnterToExit();
124122
return 1;
125123
}
@@ -145,7 +143,7 @@ int modifyAdibou3Ini() {
145143
if (!fileExists("Adibou3.ini")) {
146144
system("ren ADIBOU3.INI Adibou3.ini") >= 0;
147145
}
148-
int editAdibou3Ini = system("notepad Adibou3.ini");
146+
system("notepad Adibou3.ini") >= 0;
149147
#else
150148
if (!fileExists("Adibou3.ini")) {
151149
system("mv ADIBOU3.INI Adibou3.ini") >= 0;
@@ -201,10 +199,8 @@ void loadLicenceFile() {
201199
}
202200

203201
void runUNINST() {
204-
char uninst[11] = "UNINST.EXE";
205-
206-
if (!fileExists(uninst)) {
207-
fprintf(stderr ,"Error: %s not found in directory.\n", uninst);
202+
if (!fileExists("UNINST.EXE")) {
203+
fprintf(stderr ,"Error: UNINST.EXE not found in directory.\n");
208204
TaskExecution::pressEnterToExit();
209205
return;
210206
}
@@ -406,7 +402,7 @@ if (usedLoader7OrDev7VM) {
406402
ConsoleUtils::clearConsole();
407403
}
408404

409-
printf("Total playtime: %d hours, %d minutes %d secounds.\n\n", hours, minutes, seconds);
405+
printf("Total playtime: %d hours, %d minutes, %d secounds.\n\n", hours, minutes, seconds);
410406

411407
printf("Would you like to restart DEV7Launcher? (y/n): ");
412408
char restartChoice;

0 commit comments

Comments
 (0)