diff --git a/Common/Context.cpp b/Common/Context.cpp index ccc00fb65ea44da83184d5aa4be6a306de0f8228..6cb72bb96af79fec0ff9e1912ee8494be684877d 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -79,6 +79,7 @@ CTX::CTX() : gamepad(0) // need to initialize these too, since the corresponding opt_XXX routines use // the current value to detect changes + geom.hideCompounds = 1; mesh.changed = 0; mesh.qualityInf = mesh.qualitySup = mesh.qualityType = 0; mesh.radiusInf = mesh.radiusSup = 0; diff --git a/Common/OS.cpp b/Common/OS.cpp index 38ccd2e868cd7b3cc46f518e3f0639b0c110f29c..566536acfd9ecbbaef16070cd75743ea85773574 100644 --- a/Common/OS.cpp +++ b/Common/OS.cpp @@ -418,7 +418,9 @@ std::string GetExecutableFileName() } #elif defined(__linux__) char path[4096]; - if(readlink("/proc/self/exe", path, 4096) > 0){ + int n = readlink("/proc/self/exe", path, sizeof(path)); + if(n > 0 && n < sizeof(path)){ + path[n] = '\0'; name = std::string(path); } #endif