// remove ending \r\n if exists
if (avp_val.s.s[line.len-2] == '\r' && avp_val.s.s[line.len-1] == '\n')
{
avp_val.s.s[line.len-2] = '\0';
avp_val.s.len -= 2;
}
As avp_val is a reference to the found line which is also a reference to the line in the message, all modification made to this var will also be applied to the message. Am I wrong?
Thank you,