MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / print_av_var

Function print_av_var

modules/exec/exec_hf.c:195–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193
194
195static int print_av_var(struct hf_wrapper *w)
196{
197 int env_len;
198 char *env;
199 char *c;
200
201 env_len=w->u.av.attr.len+1/*assignment*/+w->u.av.val.len+1/*ZT*/;
202 env=pkg_malloc(env_len);
203 if (!env) {
204 LM_ERR("no pkg mem\n");
205 return 0;
206 }
207 c=env;
208 memcpy(c, w->u.av.attr.s, w->u.av.attr.len); c+=w->u.av.attr.len;
209 *c=EV_ASSIGN;c++;
210 memcpy(c, w->u.av.val.s, w->u.av.val.len);c+=w->u.av.val.len;
211 *c=0; /* zero termination */
212 w->envvar=env;
213 return 1;
214}
215
216/* creates a malloc-ed string with environment variable; returns 1 on success,
217 * 0 on failure */

Callers 1

print_varFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected