diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 9cd49d4eb..0f6479d7d 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -116,9 +116,10 @@ namespace bgfx BX_UNUSED(_filePath, _width, _height, _pitch, _data, _size, _yflip); #if BX_CONFIG_CRT_FILE_READER_WRITER - char* filePath = (char*)alloca(strlen(_filePath)+5); - strcpy(filePath, _filePath); - strcat(filePath, ".tga"); + const size_t len = bx::strnlen(_filePath)+5; + char* filePath = (char*)alloca(len); + bx::strlncpy(filePath, len, _filePath); + bx::strlncat(filePath, len, ".tga"); bx::CrtFileWriter writer; if (bx::open(&writer, filePath) ) @@ -526,7 +527,7 @@ namespace bgfx return _default; } - if (0 == strncmp(ptr, "0m", 2) ) + if (0 == bx::strncmp(ptr, "0m", 2) ) { _ptr = ptr + 2; return _default; @@ -1071,7 +1072,7 @@ namespace bgfx void UniformBuffer::writeMarker(const char* _marker) { - uint16_t num = (uint16_t)strlen(_marker)+1; + uint16_t num = (uint16_t)bx::strnlen(_marker)+1; uint32_t opcode = encodeOpcode(bgfx::UniformType::Count, 0, num, true); write(opcode); write(_marker, num); diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 48851afa1..851da6017 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -24,9 +24,6 @@ #include #include // va_list -#include -#include -#include #include // Check handle, cannot be bgfx::invalidHandle and must be valid.