Skip to content

Commit

Permalink
Fix wasm tinystl compile error (#3406)
Browse files Browse the repository at this point in the history
* utilize bx::strLen instead of C function

* utilize bx::strCopy instead of C function
  • Loading branch information
nathanstouffer authored Feb 4, 2025
1 parent 736bffa commit b927871
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/glcontext_html5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ namespace bgfx { namespace gl
SwapChainGL(int _context, const char* _canvas)
: m_context(_context)
{
m_canvas = (char*)bx::alloc(g_allocator, strlen(_canvas) + 1);
strcpy(m_canvas, _canvas);
size_t length = bx::strLen(_canvas) + 1;
m_canvas = (char*)bx::alloc(g_allocator, length);
bx::strCopy(m_canvas, length, _canvas);

makeCurrent();
GL_CHECK(glClearColor(0.0f, 0.0f, 0.0f, 0.0f) );
Expand Down

0 comments on commit b927871

Please sign in to comment.