<p></p>
<p dir="auto">Hello can you please remove the uncessary condition if (c==0 || c== 1) {} and leave only the body of that condition please and remove also the unused c variable. we dont need it.</p>
<p dir="auto">should be like this</p>
<pre class="notranslate"><code class="notranslate">int tps_reappend_via_separate_header(sip_msg_t *msg, tps_data_t *ptsd, str *hbody)
{
str hname = str_init("Via");
int i;
str sb;
char *p = NULL;
if(hbody==NULL || hbody->s==NULL || hbody->len<=0 || hbody->s[0]=='\0')
return 0;
sb.len = 1;
p = hbody->s;
for(i=0; i<hbody->len-1; i++) {
if(hbody->s[i]==',') {
if(sb.len>0) {
sb.s = p;
if(sb.s[sb.len-1]==',') sb.len--;
if(tps_add_headers(msg, &hname, &sb, 0)<0) {
return -1;
}
}
sb.len = 0;
p = hbody->s + i + 1;
}
sb.len++;
}
if(sb.len>0) {
sb.s = p;
if(sb.s[sb.len-1]==',') sb.len--;
if(tps_add_headers(msg, &hname, &sb, 0)<0) {
return -1;
}
}
return 0;
}
</code></pre>
<p dir="auto">Thanks.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/3220#issuecomment-1217546116">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZN2GA3GVICJJSMBDQDVZSFUZANCNFSM56W2LFQQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZJEKGCOLR2IZWCUUWDVZSFUZA5CNFSM56W2LFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJCJEPBA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/pull/3220/c1217546116</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/3220#issuecomment-1217546116",
"url": "https://github.com/kamailio/kamailio/pull/3220#issuecomment-1217546116",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>