]> git.mxchange.org Git - flightgear.git/blobdiff - utils/propmerge/propmerge.cxx
Maik Justus: Crash Fix.
[flightgear.git] / utils / propmerge / propmerge.cxx
index 61eb5b3bd7fdc51670e4bce90b938ed046207ac8..ab46379004f4e634fb1d6d754d4055a651587a66 100644 (file)
@@ -18,11 +18,13 @@ int main(int argc, char *argv[])
 {
        if (argc < 2) {
                usage();
-               return -1;
+               return 1;
        }
 
+       sglog().setLogLevels(SG_ALL, SG_ALERT);
+
        int numfiles = 0;
-       string out;
+       string outfile;
        SGPropertyNode root;
 
        for (int i = 1; i < argc; i++) {
@@ -35,7 +37,7 @@ int main(int argc, char *argv[])
                if (s == "-o" || s == "--output") {
                        if (i + 1 == argc)
                                break;
-                       out = argv[++i];
+                       outfile = argv[++i];
                        continue;
                }
 
@@ -44,24 +46,24 @@ int main(int argc, char *argv[])
                        numfiles++;
                } catch (const sg_exception &e) {
                        cerr << "Error: " << e.getFormattedMessage() << endl;
-                       return -2;
+                       return 2;
                }
        }
 
        if (!numfiles) {
                cerr << "Error: Nothing to merge." << endl;
-               return -3;
+               return 3;
        }
 
        try {
-               if (out.empty())
+               if (outfile.empty())
                        writeProperties(cout, &root, true);
                else
-                       writeProperties(out, &root, true);
+                       writeProperties(outfile, &root, true);
 
        } catch (const sg_exception &e) {
                cerr << "Error: " << e.getFormattedMessage() << endl;
-               return -4;
+               return 4;
        }
 
        return 0;