From ed996fe32f3aab2a48002d68e896342e41180c47 Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Sat, 22 Nov 2014 14:10:16 +0530 Subject: [PATCH] Remove defensive assert in cookies.c --- src/ChangeLog | 5 +++++ src/cookies.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4a2b1b9c..c0d64666 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-11-22 Darshit Shah + + * cookies.c (discard_matching_cookie): Replace defensive assert with a + logical check and error message + 2014-11-22 Darshit Shah * wget.h: Make extern declaration for program_argstring. diff --git a/src/cookies.c b/src/cookies.c index 365f8d50..289071e9 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -304,7 +304,12 @@ discard_matching_cookie (struct cookie_jar *jar, struct cookie *cookie) res = hash_table_get_pair (jar->chains, victim->domain, &chain_key, NULL); - assert (res != 0); + + if (res == 0) + { + logprintf (LOG_VERBOSE, _("Unable to get cookie for %s\n"), + victim->domain); + } if (!victim->next) { /* VICTIM was the only cookie in the chain. Destroy the