mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-17 01:04:19 +00:00
Demo: use locally defined strdup because compilers/standard librairies are an annoyance (#520)
This commit is contained in:
parent
2c6bc95dd5
commit
dafedc3246
2 changed files with 10 additions and 9 deletions
|
|
@ -830,10 +830,9 @@ int ImStrnicmp(const char* str1, const char* str2, int count)
|
|||
|
||||
char* ImStrdup(const char *str)
|
||||
{
|
||||
char *buff = (char*)ImGui::MemAlloc(strlen(str) + 1);
|
||||
IM_ASSERT(buff);
|
||||
strcpy(buff, str);
|
||||
return buff;
|
||||
size_t len = strlen(str) + 1;
|
||||
void* buff = ImGui::MemAlloc(len);
|
||||
return (char*)memcpy(buff, (const void*)str, len);
|
||||
}
|
||||
|
||||
int ImStrlenW(const ImWchar* str)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue