Skip to content

Commit

Permalink
cleanup code and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarrod Baumann committed May 31, 2015
1 parent f70fdb9 commit a9d3150
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions transformations.c
Expand Up @@ -742,15 +742,14 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype,
/* width cant be greater than buffer */
return -1;

j = i - val->rs.len;
j = i - val->rs.len; /* calc extra length */
p = _tr_buffer;

/* copy existing string to buffer and append j spaces */
memcpy(p, val->rs.s, val->rs.len);
memset(p+val->rs.len, ' ', j);
/*snprintf(_tr_buffer, i, "%*s%*s",
val->rs.len, val->rs.s,
j-1, " ");
*/
memset(val, 0, sizeof(pv_value_t));

val->flags = PV_VAL_STR;
val->rs.s = _tr_buffer;
val->rs.len = i;
Expand Down

0 comments on commit a9d3150

Please sign in to comment.