aboutsummaryrefslogtreecommitdiff
path: root/src/or/channel.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-03-10 08:32:58 -0400
committerNick Mathewson <nickm@torproject.org>2013-03-10 19:52:06 -0400
commit339df5df085e2115c01881cf628abe5ed3fbd456 (patch)
tree3a7e4f2f2c695e7506eda20e3637081f6fb5009a /src/or/channel.c
parent74c33945e3c8c441111f0cb3dd0e5097ad2155f5 (diff)
downloadtor-339df5df085e2115c01881cf628abe5ed3fbd456.tar.gz
tor-339df5df085e2115c01881cf628abe5ed3fbd456.zip
Fix 8447: use %u to format circid_t.
Now that circid_t is 4 bytes long, the default integer promotions will leave it alone when sizeof(int) == 4, which will leave us formatting an unsigned as an int. That's technically undefined behavior. Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not in any released Tor.
Diffstat (limited to 'src/or/channel.c')
-rw-r--r--src/or/channel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index f8afc405e6..82db061af9 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -2607,17 +2607,17 @@ channel_send_destroy(circid_t circ_id, channel_t *chan, int reason)
cell.command = CELL_DESTROY;
cell.payload[0] = (uint8_t) reason;
log_debug(LD_OR,
- "Sending destroy (circID %d) on channel %p "
+ "Sending destroy (circID %u) on channel %p "
"(global ID " U64_FORMAT ")",
- circ_id, chan,
+ (unsigned)circ_id, chan,
U64_PRINTF_ARG(chan->global_identifier));
channel_write_cell(chan, &cell);
} else {
log_warn(LD_BUG,
- "Someone called channel_send_destroy() for circID %d "
+ "Someone called channel_send_destroy() for circID %u "
"on a channel " U64_FORMAT " at %p in state %s (%d)",
- circ_id, U64_PRINTF_ARG(chan->global_identifier),
+ (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier),
chan, channel_state_to_string(chan->state),
chan->state);
}