diff options
author | Alexander Færøy <ahf@0x90.dk> | 2014-06-21 10:46:46 +0200 |
---|---|---|
committer | Alexander Færøy <ahf@0x90.dk> | 2014-06-21 10:46:46 +0200 |
commit | 5fe144503d9a282ea66ba9962dd4e8c568dbb78c (patch) | |
tree | 0309cf9189126e5d1da464c6d379e83cb1ef3a9d | |
parent | 9d0d4d9437649ed96381120e68a8d4035f6ded7e (diff) | |
parent | 444f9e48368bdd3e1e6e3a943ecc0d10c9350ef1 (diff) | |
download | irssi-5fe144503d9a282ea66ba9962dd4e8c568dbb78c.zip |
Merge pull request #54 from dajohi/dcc_send_strict_aliasing
Do not break strict-aliasing rules.
-rw-r--r-- | src/irc/dcc/dcc-send.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/irc/dcc/dcc-send.c b/src/irc/dcc/dcc-send.c index 6d2b794d..930ef770 100644 --- a/src/irc/dcc/dcc-send.c +++ b/src/irc/dcc/dcc-send.c @@ -293,7 +293,8 @@ static void dcc_send_read_size(SEND_DCC_REC *dcc) if (dcc->count_pos != 4) return; - bytes = ntohl(*((guint32 *) dcc->count_buf)); + memcpy(&bytes, dcc->count_buf, sizeof(bytes)); + bytes = ntohl(bytes); dcc->count_pos = 0; if (dcc->waitforend && bytes == (dcc->transfd & 0xffffffff)) { |