Merge pull request #169 from kiwix/infinit_redirect

Correctly pre-increment the loopCounter.
This commit is contained in:
Matthieu Gautier 2018-03-26 10:04:28 +02:00 committed by GitHub
commit 9997a6ec18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -626,7 +626,7 @@ static struct MHD_Response* handle_content(RequestContext* request)
if (found) {
/* If redirect */
unsigned int loopCounter = 0;
while (article.isRedirect() && loopCounter++ < 42) {
while (article.isRedirect() && ++loopCounter < 42) {
article = article.getRedirectArticle();
}