diff --git a/src/SampSharp/SampSharp.vcxproj b/src/SampSharp/SampSharp.vcxproj index f9881e28..5b8ea1bb 100644 --- a/src/SampSharp/SampSharp.vcxproj +++ b/src/SampSharp/SampSharp.vcxproj @@ -57,7 +57,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPGDK_AMALGAMATION;SAMPGDK_CPP_WRAPPERS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPGDK_AMALGAMATION;SAMPGDK_CPP_WRAPPERS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) includes;includes/sdk;includes/sdk/amx;%(AdditionalIncludeDirectories) false true @@ -82,7 +82,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPGDK_AMALGAMATION;SAMPGDK_CPP_WRAPPERS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPGDK_AMALGAMATION;SAMPGDK_CPP_WRAPPERS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) includes;includes/sdk;includes/sdk/amx stdcpp17 diff --git a/src/SampSharp/plugin.cpp b/src/SampSharp/plugin.cpp index ed75533b..d07b089e 100644 --- a/src/SampSharp/plugin.cpp +++ b/src/SampSharp/plugin.cpp @@ -215,12 +215,10 @@ bool plugin::detect_coreclr(std::string &value, fs::path path) { } bool plugin::detect_coreclr(std::string &value) { - char runtime[256]; - size_t runtime_len; - getenv_s(&runtime_len, runtime, 256, "SAMPSHARP_RUNTIME"); + const auto runtime = getenv("SAMPSHARP_RUNTIME"); return - runtime_len > 0 && runtime_len < 256 && detect_coreclr(value, runtime) || + runtime && strlen(runtime) > 0 && detect_coreclr(value, runtime) || detect_coreclr(value, "runtime") || detect_coreclr(value, "dotnet"); }