| 2236 | } |
| 2237 | |
| 2238 | char* 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 | |
| 2252 | const char* ImStrchrRange(const char* str, const char* str_end, char c) |
| 2253 | { |