[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] [PATCH 8/8] Supplement logical assumption assert with error m
From: |
Darshit Shah |
Subject: |
[Bug-wget] [PATCH 8/8] Supplement logical assumption assert with error message |
Date: |
Sat, 22 Nov 2014 14:52:22 +0530 |
---
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 <address@hidden>
+ * hosts.c (address_list_set_faulty): Add a helpful error message for
when a
+ logical assumption fails
+
+2014-11-22 Darshit Shah <address@hidden>
+
* 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 address@hidden"));
+ abort();
+ }
++al->faulty;
if (al->faulty >= al->count)
--
2.1.3
- Re: [Bug-wget] [PATCH 2/8] Add extern declaration for version.c strings, (continued)
- [Bug-wget] [PATCH 1/8] Mark unused paramter in utils.c, Darshit Shah, 2014/11/22
- [Bug-wget] [PATCH 3/8] Fix missing extern declaration error for build_info.pl, Darshit Shah, 2014/11/22
- [Bug-wget] [PATCH 5/8] Make extern declaration for program_name, Darshit Shah, 2014/11/22
- [Bug-wget] [PATCH 4/8] Declare extern numurls in common header, Darshit Shah, 2014/11/22
- [Bug-wget] [PATCH 6/8] Add extern declaration for program_arsgstring, Darshit Shah, 2014/11/22
- [Bug-wget] [PATCH 7/8] Remove defensive assert in cookies.c, Darshit Shah, 2014/11/22
- [Bug-wget] [PATCH 8/8] Supplement logical assumption assert with error message,
Darshit Shah <=
- Re: [Bug-wget] Fix various compiler warnings, Tim Rühsen, 2014/11/22
- Re: [Bug-wget] Fix various compiler warnings, Giuseppe Scrivano, 2014/11/24