summaryrefslogtreecommitdiff
path: root/src/common/address.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/address.c')
-rw-r--r--src/common/address.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/address.c b/src/common/address.c
index fac9d50e15..2fe013a2cd 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -373,10 +373,11 @@ tor_addr_parse_reverse_lookup_name(tor_addr_t *result, const char *address,
return -1; /* malformed. */
/* reverse the bytes */
- inaddr.s_addr = (((inaddr.s_addr & 0x000000fful) << 24)
- |((inaddr.s_addr & 0x0000ff00ul) << 8)
- |((inaddr.s_addr & 0x00ff0000ul) >> 8)
- |((inaddr.s_addr & 0xff000000ul) >> 24));
+ inaddr.s_addr = (uint32_t)
+ (((inaddr.s_addr & 0x000000ff) << 24)
+ |((inaddr.s_addr & 0x0000ff00) << 8)
+ |((inaddr.s_addr & 0x00ff0000) >> 8)
+ |((inaddr.s_addr & 0xff000000) >> 24));
if (result) {
tor_addr_from_in(result, &inaddr);