Skip to content

Remove magic numbers when setting exit codes

username-removed-819582 requested to merge darnir/wget2:exit-code into master

Magic numbers are bad, they make the code very difficult to read since one must guess their intention. Which is why this commit eliminates all the magic numbers for setting the exit status and replaces them with a structured enum. This has the added benefit of having these values as symbols in the final symbol table.

  • src/wget.c: Replace all calls to set_exit_status() to use the exit_status_t enum values
  • src/wget_main.h: Define the exit_status_t enum and associated exit error code values
Edited by username-removed-791447

Merge request reports

Loading