summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-04-26 03:24:04 +0200
committerNick Mathewson <nickm@torproject.org>2011-05-09 13:19:45 -0400
commit8ebb3ce6e27c104e35d65662c04d23795f2b5605 (patch)
tree2661ac5d940d4b9e6b46fd6c5bdbcdd39ca4110b /src
parent80e57af50fe06ac76733ee99644c5efe797b2b8c (diff)
downloadtor-8ebb3ce6e27c104e35d65662c04d23795f2b5605.tar.gz
tor-8ebb3ce6e27c104e35d65662c04d23795f2b5605.zip
CONN_LOG_PROTECT()'s first argument may not be 0
Make that explicit by adding an assert and removing a null-check. All of its callers currently depend on the argument being non-null anyway. Silences a few clang complaints.
Diffstat (limited to 'src')
-rw-r--r--src/or/or.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 7d354c8fe1..f693ad908c 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3203,7 +3203,9 @@ typedef enum buildtimeout_set_event_t {
*/
#define CONN_LOG_PROTECT(conn, stmt) \
STMT_BEGIN \
- int _log_conn_is_control = (conn && conn->type == CONN_TYPE_CONTROL); \
+ int _log_conn_is_control; \
+ tor_assert(conn); \
+ _log_conn_is_control = (conn->type == CONN_TYPE_CONTROL); \
if (_log_conn_is_control) \
disable_control_logging(); \
STMT_BEGIN stmt; STMT_END; \