Skip to content

Commit

Permalink
str_strcmp: Silence noisy log
Browse files Browse the repository at this point in the history
(cherry picked from commit 2af6cef)
  • Loading branch information
liviuchircu committed May 22, 2019
1 parent 1abc780 commit 454d58d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ut.h
Expand Up @@ -888,15 +888,16 @@ static inline int str_strcmp(const str *stra, const str *strb)
if(stra==NULL || strb==NULL || stra->s ==NULL || strb->s==NULL
|| stra->len<0 || strb->len<0)
{
LM_ERR("bad parameters\n");
#ifdef EXTRA_DEBUG
LM_DBG("bad parameters\n");
#endif
return -2;
}

alen = stra->len;
blen = strb->len;
minlen = (alen < blen ? alen : blen);


for (i = 0; i < minlen; i++) {
const char a = stra->s[i];
const char b = strb->s[i];
Expand All @@ -905,6 +906,7 @@ static inline int str_strcmp(const str *stra, const str *strb)
if (a > b)
return 1;
}

if (alen < blen)
return -1;
else if (alen > blen)
Expand Down

0 comments on commit 454d58d

Please sign in to comment.