You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,7 +41,6 @@ int main(int argc, char* argv[]) {
41
41
return1;
42
42
}
43
43
44
-
// Here are listed the strings for OBC itself.
45
44
std::string inputOBC = argv[1];
46
45
47
46
#ifdef __unix__
@@ -52,73 +51,73 @@ int main(int argc, char* argv[]) {
52
51
#endif
53
52
54
53
// Check if the input file is an OBC Script.
55
-
fs::path inputScript(inputOBC);
56
-
if (inputScript.extension() != ".obc") {
57
-
std::cerr << "Error: This File is not an OBC Script!" << std::endl;
54
+
fs::path inputFile(inputOBC);
55
+
if (inputFile.extension() != ".obc") {
56
+
fprintf(stderr, "Error: This File is not an OBC Script!");
58
57
return1;
59
58
}
60
59
61
60
// Use the OBC Script for Input
62
61
std::ifstream OBCInput(inputOBC);
63
62
64
63
if (!OBCInput) {
65
-
std::cerr << "Error: Unable to find OBC Script." << std::endl;
64
+
fprintf(stderr, "Error: Unable to load OBC Script.");
66
65
return1;
67
66
}
68
67
69
-
std::string checkEntrypointOBC;
68
+
std::string checkEntrypoint;
70
69
char c;
71
70
for (int i = 0; i < 25 && OBCInput.get(c); ++i) {
72
-
checkEntrypointOBC += c;
71
+
checkEntrypoint += c;
73
72
}
74
73
75
74
// Uses the OBC Copyright MDO as Entrypoint adds automatically also the last four number of the Year.
76
75
// (usually it is 1999, due to OBCEditor it is possible to change this Year so this Change is made so the modified Scripts are always compatible with OBCViewer)
77
76
int number;
78
-
if (sscanf(checkEntrypointOBC.c_str(), "OBC Copyright MDO %d", &number) != 1) {
79
-
printf("Error: Unable to find the number of the Entrypoint!");
77
+
if (sscanf(checkEntrypoint.c_str(), "OBC Copyright MDO %d", &number) != 1) {
78
+
fprintf(stderr, "Error: Unable to find the Entrypoint!");
0 commit comments