| 1325 | } |
| 1326 | |
| 1327 | char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* src) |
| 1328 | { |
| 1329 | size_t dst_buf_size = p_dst_size ? *p_dst_size : strlen(dst) + 1; |
| 1330 | size_t src_size = strlen(src) + 1; |
| 1331 | if (dst_buf_size < src_size) |
| 1332 | { |
| 1333 | IM_FREE(dst); |
| 1334 | dst = (char*)IM_ALLOC(src_size); |
| 1335 | if (p_dst_size) |
| 1336 | *p_dst_size = src_size; |
| 1337 | } |
| 1338 | return (char*)memcpy(dst, (const void*)src, src_size); |
| 1339 | } |
| 1340 | |
| 1341 | const char* ImStrchrRange(const char* str, const char* str_end, char c) |
| 1342 | { |