| 95 | |
| 96 | |
| 97 | my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, |
| 98 | size_t length) |
| 99 | { |
| 100 | char *new_ptr; |
| 101 | if (str->length+length >= str->max_length) |
| 102 | { |
| 103 | size_t new_length=(str->length+length+str->alloc_increment)/ |
| 104 | str->alloc_increment; |
| 105 | new_length*=str->alloc_increment; |
| 106 | if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME)))) |
| 107 | return TRUE; |
| 108 | str->str=new_ptr; |
| 109 | str->max_length=new_length; |
| 110 | } |
| 111 | memcpy(str->str + str->length,append,length); |
| 112 | str->length+=length; |
| 113 | str->str[str->length]=0; /* Safety for C programs */ |
| 114 | return FALSE; |
| 115 | } |
| 116 | |
| 117 | |
| 118 | my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n) |
no test coverage detected