mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 06:48:05 +01:00
Use a simpler fix for the byte-reversing warning
This commit is contained in:
parent
aea9cf1011
commit
2f0184ece1
1 changed files with 5 additions and 4 deletions
|
@ -373,10 +373,11 @@ tor_addr_parse_reverse_lookup_name(tor_addr_t *result, const char *address,
|
||||||
return -1; /* malformed. */
|
return -1; /* malformed. */
|
||||||
|
|
||||||
/* reverse the bytes */
|
/* reverse the bytes */
|
||||||
inaddr.s_addr = (((inaddr.s_addr & (uint32_t)0x000000fful) << 24)
|
inaddr.s_addr = (uint32_t)
|
||||||
|((inaddr.s_addr & (uint32_t)0x0000ff00ul) << 8)
|
(((inaddr.s_addr & 0x000000fful) << 24)
|
||||||
|((inaddr.s_addr & (uint32_t)0x00ff0000ul) >> 8)
|
|((inaddr.s_addr & 0x0000ff00ul) << 8)
|
||||||
|((inaddr.s_addr & (uint32_t)0xff000000ul) >> 24));
|
|((inaddr.s_addr & 0x00ff0000ul) >> 8)
|
||||||
|
|((inaddr.s_addr & 0xff000000ul) >> 24));
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
tor_addr_from_in(result, &inaddr);
|
tor_addr_from_in(result, &inaddr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue