diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2014-05-18 19:28:18 -0400 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2014-05-18 19:59:01 -0400 |
commit | 261a70353ff316cc993c23faf07cb0f60e2e5819 (patch) | |
tree | daf06337d77adfd054da60840754769fb28c73e7 | |
parent | 8b5e3d520825f3376ec0fd00ba3aadc60c625d5f (diff) |
Fixed a bug
-rw-r--r-- | other/bootstrap_daemon/tox_bootstrap_daemon.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/other/bootstrap_daemon/tox_bootstrap_daemon.c b/other/bootstrap_daemon/tox_bootstrap_daemon.c index 0d18d411..afe2b2ac 100644 --- a/other/bootstrap_daemon/tox_bootstrap_daemon.c +++ b/other/bootstrap_daemon/tox_bootstrap_daemon.c | |||
@@ -164,8 +164,8 @@ void parse_tcp_relay_ports_config(config_t *cfg, uint16_t **tcp_relay_ports, int | |||
164 | } | 164 | } |
165 | 165 | ||
166 | (*tcp_relay_ports)[*tcp_relay_port_count] = config_setting_get_int(elem); | 166 | (*tcp_relay_ports)[*tcp_relay_port_count] = config_setting_get_int(elem); |
167 | if ((*tcp_relay_ports)[i] < MIN_ALLOWED_PORT || (*tcp_relay_ports)[i] > MAX_ALLOWED_PORT) { | 167 | if ((*tcp_relay_ports)[*tcp_relay_port_count] < MIN_ALLOWED_PORT || (*tcp_relay_ports)[*tcp_relay_port_count] > MAX_ALLOWED_PORT) { |
168 | syslog(LOG_WARNING, "Port #%d: Invalid port: %u, should be in [%d, %d]. Skipping.\n", i, (*tcp_relay_ports)[i], MIN_ALLOWED_PORT, MAX_ALLOWED_PORT); | 168 | syslog(LOG_WARNING, "Port #%d: Invalid port: %u, should be in [%d, %d]. Skipping.\n", i, (*tcp_relay_ports)[*tcp_relay_port_count], MIN_ALLOWED_PORT, MAX_ALLOWED_PORT); |
169 | continue; | 169 | continue; |
170 | } | 170 | } |
171 | 171 | ||
@@ -173,7 +173,7 @@ void parse_tcp_relay_ports_config(config_t *cfg, uint16_t **tcp_relay_ports, int | |||
173 | } | 173 | } |
174 | 174 | ||
175 | // the loop above skips invalid ports, so we adjust the allocated memory size | 175 | // the loop above skips invalid ports, so we adjust the allocated memory size |
176 | *tcp_relay_ports = realloc(*tcp_relay_ports, *tcp_relay_port_count * sizeof(uint16_t)); | 176 | *tcp_relay_ports = realloc(*tcp_relay_ports, (*tcp_relay_port_count) * sizeof(uint16_t)); |
177 | } | 177 | } |
178 | 178 | ||
179 | // Gets general config options | 179 | // Gets general config options |