summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry/cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/cmd.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/entry/cmd.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/cmd.cpp b/3rdparty/bgfx/examples/common/entry/cmd.cpp
index 7c6c3c99307..ae3d14d3400 100644
--- a/3rdparty/bgfx/examples/common/entry/cmd.cpp
+++ b/3rdparty/bgfx/examples/common/entry/cmd.cpp
@@ -3,11 +3,6 @@
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
-#include <ctype.h> // isspace
-#include <stdint.h>
-#include <stdlib.h> // size_t
-#include <string.h> // strlen
-
#include <bx/allocator.h>
#include <bx/hash.h>
#include <bx/commandline.h>
@@ -33,7 +28,7 @@ struct CmdContext
void add(const char* _name, ConsoleFn _fn, void* _userData)
{
- uint32_t cmd = bx::hashMurmur2A(_name, (uint32_t)strlen(_name) );
+ uint32_t cmd = bx::hashMurmur2A(_name, (uint32_t)bx::strnlen(_name) );
BX_CHECK(m_lookup.end() == m_lookup.find(cmd), "Command \"%s\" already exist.", _name);
Func fn = { _fn, _userData };
m_lookup.insert(stl::make_pair(cmd, fn) );
@@ -51,7 +46,7 @@ struct CmdContext
if (argc > 0)
{
int err = -1;
- uint32_t cmd = bx::hashMurmur2A(argv[0], (uint32_t)strlen(argv[0]) );
+ uint32_t cmd = bx::hashMurmur2A(argv[0], (uint32_t)bx::strnlen(argv[0]) );
CmdLookup::iterator it = m_lookup.find(cmd);
if (it != m_lookup.end() )
{