--- src/ChangeLog | 5 +++++ src/host.c | 6 ++++++ 2 files changed, 11 insertions(+)
diff --git a/src/ChangeLog b/src/ChangeLog index c0d6466..51ce88b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2014-11-22 Darshit Shah <[email protected]> + * hosts.c (address_list_set_faulty): Add a helpful error message for when a + logical assumption fails + +2014-11-22 Darshit Shah <[email protected]> + * cookies.c (discard_matching_cookie): Replace defensive assert with a logical check and error message diff --git a/src/host.c b/src/host.c index 904650b..2e9b4f8 100644 --- a/src/host.c +++ b/src/host.c @@ -151,6 +151,12 @@ address_list_set_faulty (struct address_list *al, int index) "faulty" attempt is always preceded with all-faulty addresses, and this is how Wget uses it. */ assert (index == al->faulty); + if (index != al->faulty) + { + logprintf (LOG_ALWAYS, "index: %d\nal->faulty: %s\n", index, al->faulty); + logprintf (LOG_ALWAYS, _("Error in handling the address list.\nPlease report this issue to [email protected]\n")); + abort(); + } ++al->faulty; if (al->faulty >= al->count) -- 2.1.3
