MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / dynstr_append_mem

Function dynstr_append_mem

mysys/string.c:97–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96
97my_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
118my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n)

Callers 2

dynstr_appendFunction · 0.85
dynstr_append_os_quotedFunction · 0.85

Calls 1

my_reallocFunction · 0.85

Tested by

no test coverage detected