| 153 | |
| 154 | |
| 155 | static int append_str( var_str * to, str from) |
| 156 | { |
| 157 | if(to->len + from.len > to->allocated) |
| 158 | { |
| 159 | to->s = (char*) pkg_realloc(to->s, to->len + from.len + 1); |
| 160 | to->allocated = to->len + from.len; |
| 161 | |
| 162 | if( to->s == NULL) |
| 163 | { |
| 164 | LM_ERR("Out of memory\n"); |
| 165 | return -1; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | memcpy( to->s+to->len, from.s, from.len ); |
| 170 | to->len += from.len; |
| 171 | |
| 172 | to->s[to->len] = 0; |
| 173 | |
| 174 | return 0; |
| 175 | |
| 176 | } |
| 177 | |
| 178 | static int append_const(var_str* to, char * from) |
| 179 | { |
no outgoing calls
no test coverage detected