Remove illogical assertion in ftp.c

A call to assert(1) will always fail and cause Wget to crash. If such a
situation does arise, Wget should invoke abort() and provide a useful
error message to the user prior to exiting.
This commit is contained in:
Darshit Shah 2014-12-04 18:46:44 +05:30
parent 4b845615fa
commit aaefe8bc83
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2014-12-04 Darshit Shah <darnir@gmail.com>
* ftp.c (getftp): Remove a call to assert(1) and replace with error message
2014-12-04 Darshit Shah <darnir@gmail.com>
* wget.h: Define MIX and MAX macros globally for all files

View File

@ -724,8 +724,10 @@ Error in server response, closing control connection.\n"));
break;
default:
/* Can't happen. */
assert (1);
logprintf (LOG_ALWAYS, _("Logically impossible section reached in getftp()"));
logprintf (LOG_ALWAYS, _("cwd_count: %d\ncwd_start: %d\ncwd_end: %d\n"),
cwd_count, cwd_start, cwd_end);
abort ();
}
if (!opt.server_response)