if (pos == NULL || pos == address)
return 1;
- *host = (char *)g_malloc (pos - address + 1);
- strncpy (*host, address, pos - address);
- (*host) [pos - address] = '\0';
+ size_t len = pos - address;
+ *host = (char *)g_malloc (len + 1);
+ memcpy (*host, address, len);
+ (*host) [len] = '\0';
*port = atoi (pos + 1);
debugger_thread_id = mono_native_thread_id_get ();
MonoThread *thread = mono_thread_attach (mono_get_root_domain ());
- mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "Debugger agent"), TRUE, &error);
+ mono_thread_set_name_internal (thread->internal_thread, mono_string_new (mono_get_root_domain (), "Debugger agent"), TRUE, FALSE, &error);
mono_error_assert_ok (&error);
thread->internal_thread->state |= ThreadState_Background;