Skip to content

Commit

Permalink
cppcheck: Fix a couple of warnings about the "returned" variable in m…
Browse files Browse the repository at this point in the history
…ythnetvision.

1) This variable is declared as a "uint" so it can never be less than
zero.  2) One the value of zero has been handled, the test for >0 is
redundant.
  • Loading branch information
linuxdude42 committed Oct 2, 2020
1 parent 489bedb commit b282281
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mythplugins/mythnetvision/mythnetvision/netsearch.cpp
Expand Up @@ -370,7 +370,7 @@ void NetSearch::SearchFinished(void)
m_nextPageToken = item->nextPageToken();
m_prevPageToken = item->prevPageToken();

if (returned <= 0)
if (returned == 0)
return;

m_siteList->GetItemAt(m_currentGrabber)->
Expand All @@ -384,7 +384,7 @@ void NetSearch::SearchFinished(void)
if (searchresults % returned != 0) // Partial page?
m_maxpage++;
}
if (m_pageText && m_maxpage > 0 && m_pagenum > 0 && returned > 0)
if (m_pageText && m_maxpage > 0 && m_pagenum > 0)
{
m_pageText->SetText(QString("%1 / %2")
.arg(QString::number(m_pagenum))
Expand Down

0 comments on commit b282281

Please sign in to comment.