aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-05-29 23:28:01 -0400
committerNick Mathewson <nickm@torproject.org>2009-05-29 23:28:01 -0400
commitd66c3797650698778bd098bbaf9d3bbeebfa9fcf (patch)
tree603d556a97a3a8693c9f48e8f5fd9a1b1640ecc8 /src
parente70fe116d3726401e0205e115294208a948a292e (diff)
downloadtor-d66c3797650698778bd098bbaf9d3bbeebfa9fcf.tar
tor-d66c3797650698778bd098bbaf9d3bbeebfa9fcf.tar.gz
Clean up a bit of C logic, and fix an erroneous warning.
(Simplify "if (cond) return 1; return 0;" to "return cond;", and don't give a warning when we start with accounting on but dirport off.)
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 5bf3fd41b..81999516d 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2634,12 +2634,11 @@ is_listening_on_low_port(uint16_t port_option,
#else
const config_line_t *l;
uint16_t p;
- if (listen_options == NULL) {
- if (port_option < 1024) {
- return 1;
- }
- return 0;
- }
+ if (port_option == 0)
+ return 0; /* We're not listening */
+ if (listen_options == NULL)
+ return (port_option < 1024);
+
for (l = listen_options; l; l = l->next) {
parse_addr_port(LOG_WARN, l->value, NULL, NULL, &p);
if (p<1024) {