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:
mbusc
2025-08-28 21:25:25 +02:00
parent b97d9f2d7f
commit cd7e957692
5 changed files with 24 additions and 18 deletions

View File

@ -40,6 +40,9 @@ set(HEADERS
# Create the shared library
add_library(privatebinapi SHARED ${SOURCES} ${HEADERS})
# Define PRIVATEBINAPI_EXPORTS for the library build
target_compile_definitions(privatebinapi PRIVATE PRIVATEBINAPI_EXPORTS)
# Include directories
target_include_directories(privatebinapi PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
@ -110,4 +113,4 @@ if(ENABLE_LLVM_COVERAGE)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS privatebinapi
)
endif()
endif()