strncmp return code check in linkspam

This commit is contained in:
Brian Rasmusson
2016-10-21 21:58:32 +02:00
parent 10aa36fa75
commit 5892c078fd

@ -919,7 +919,7 @@ bool isLinkSpam ( const Url *linker,
if ( ! link ) continue;
if ( linkLen <= 0 ) continue;
if ( linkLen > uulen ) continue;
if ( strncmp ( link , uu , uulen ) ) continue;
if ( strncmp ( link , uu , uulen ) != 0 ) continue;
// got a match, is it a link chain? if not, them we are not
goto loop;
}
@ -1040,10 +1040,10 @@ static bool isLinkChain ( Xml *xml, const Url *linker, const Url *linkee, int32_
// there is left/right text, like the guy that had a list
// to 3 different gigablast.com links in a row with no
// text in between
if ( leftUrl.getDomainLen() != linkee->getDomainLen() ) break;
if ( strncmp ( leftUrl.getDomain() ,
linkee->getDomain() ,
linkee->getDomainLen() ) ) break;
if ( leftUrl.getDomainLen() != linkee->getDomainLen() )
break;
if( strncmp(leftUrl.getDomain(), linkee->getDomain(), linkee->getDomainLen()) != 0 )
break;
}
// we start off in link text, since linkNode is an <a> tag
@ -1111,10 +1111,10 @@ static bool isLinkChain ( Xml *xml, const Url *linker, const Url *linkee, int32_
// there is left/right text, like the guy that had a list
// to 3 different gigablast.com links in a row with no
// text in between
if ( rightUrl.getDomainLen() != linkee->getDomainLen() ) break;
if ( strncmp ( rightUrl.getDomain() ,
linkee->getDomain() ,
linkee->getDomainLen() ) ) break;
if ( rightUrl.getDomainLen() != linkee->getDomainLen() )
break;
if ( strncmp(rightUrl.getDomain(), linkee->getDomain(), linkee->getDomainLen()) != 0 )
break;
}
if ( tableLeft && tableRight ) {