MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ImStrdupcpy

Function ImStrdupcpy

imgui_tiny_app/imgui/imgui.cpp:2238–2250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2236}
2237
2238char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* src)
2239{
2240 size_t dst_buf_size = p_dst_size ? *p_dst_size : ImStrlen(dst) + 1;
2241 size_t src_size = ImStrlen(src) + 1;
2242 if (dst_buf_size < src_size)
2243 {
2244 IM_FREE(dst);
2245 dst = (char*)IM_ALLOC(src_size);
2246 if (p_dst_size)
2247 *p_dst_size = src_size;
2248 }
2249 return (char*)memcpy(dst, (const void*)src, src_size);
2250}
2251
2252const char* ImStrchrRange(const char* str, const char* str_end, char c)
2253{

Callers 1

BeginMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected