Fix compiler warnings and improve code quality
- Replace unsafe strcpy with strcpy_s for better security - Fix DLL binding issues by adding PRIVATEBIN_API macros - Add explicit type casts to resolve size conversion warnings - Replace unsafe getenv with _dupenv_s for better security - Add PRIVATEBINAPI_EXPORTS definition in CMakeLists.txt - Improve CMake configuration for better build compatibility
This commit is contained in:
@ -21,9 +21,12 @@ static bool extract_paste_id_and_key(const std::string& full_url, std::string& p
|
||||
}
|
||||
|
||||
int main() {
|
||||
const char* it = std::getenv("PRIVATEBIN_IT");
|
||||
char* it = nullptr;
|
||||
size_t len = 0;
|
||||
_dupenv_s(&it, &len, "PRIVATEBIN_IT");
|
||||
if (!it || std::string(it) == "0") {
|
||||
std::cout << "[test] PRIVATEBIN_IT not set; skipping integration test." << std::endl;
|
||||
free(it);
|
||||
return 0; // treat as success when integration testing is disabled
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user