3
0
Fork 0

Correctly pre-increment the loopCounter.

In case of infinit redirection, if we post-increment the loop counter,
we will exit the loop when loopCounter will be 42 and increment it.
So loop counter will be 43.

Let's pre-increment the counter to still compare with 42 (more consistancy)

Fix #168
fix-bug-pid
Matthieu Gautier 8 years ago
parent 426796dc37
commit 8b6abc0e35

@ -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();
}

Loading…
Cancel
Save