Бранимир Караџић 1 year ago
parent
commit
0481ee1063
2 changed files with 10 additions and 9 deletions
  1. 1 1
      include/bx/thread.h
  2. 9 8
      src/thread.cpp

+ 1 - 1
include/bx/thread.h

@@ -72,7 +72,7 @@ namespace bx
 		uint32_t  m_stackSize;
 		uint32_t  m_stackSize;
 		int32_t   m_exitCode;
 		int32_t   m_exitCode;
 		bool      m_running;
 		bool      m_running;
-		char      m_name[32];
+		char      m_name[64];
 	};
 	};
 
 
 	///
 	///

+ 9 - 8
src/thread.cpp

@@ -132,14 +132,15 @@ namespace bx
 		m_userData = _userData;
 		m_userData = _userData;
 		m_stackSize = _stackSize;
 		m_stackSize = _stackSize;
 
 
-        if (NULL != _name)
-        {
-            strCopy(m_name, sizeof(m_name), _name);
-        }
-        else
-        {
-            m_name[0] = '\0';
-        }
+		if (NULL != _name)
+		{
+			BX_WARN(strLen(_name) < BX_COUNTOF(m_name)-1, "Truncating thread name.");
+			strCopy(m_name, BX_COUNTOF(m_name), _name);
+		}
+		else
+		{
+			m_name[0] = '\0';
+		}
 
 
 		ThreadInternal* ti = (ThreadInternal*)m_internal;
 		ThreadInternal* ti = (ThreadInternal*)m_internal;
 #if BX_CRT_NONE
 #if BX_CRT_NONE