| 1650 | } |
| 1651 | |
| 1652 | char* ImStrdupcpy(char* dst, size_t* p_dst_size, const char* src) |
| 1653 | { |
| 1654 | size_t dst_buf_size = p_dst_size ? *p_dst_size : strlen(dst) + 1; |
| 1655 | size_t src_size = strlen(src) + 1; |
| 1656 | if (dst_buf_size < src_size) |
| 1657 | { |
| 1658 | IM_FREE(dst); |
| 1659 | dst = (char*)IM_ALLOC(src_size); |
| 1660 | if (p_dst_size) |
| 1661 | *p_dst_size = src_size; |
| 1662 | } |
| 1663 | return (char*)memcpy(dst, (const void*)src, src_size); |
| 1664 | } |
| 1665 | |
| 1666 | const char* ImStrchrRange(const char* str, const char* str_end, char c) |
| 1667 | { |