diff options
author | joeyh <joeyh> | 2006-03-25 01:51:39 +0000 |
---|---|---|
committer | joeyh <joeyh> | 2006-03-25 01:51:39 +0000 |
commit | eb2a08e762578bb86e0e6135c5808a0d82e91a8c (patch) | |
tree | 093c639648a40afb8f84b80ca04da57bc0760fdd /ifdata.c | |
parent | 77f42d643d76d6aa7d884fe9c6eadd7fcc57bc64 (diff) | |
download | moreutils-eb2a08e762578bb86e0e6135c5808a0d82e91a8c.tar.gz |
* ifdata: patch from its author to make it behave properly on big endian
systems. Closes: #358860
Diffstat (limited to 'ifdata.c')
-rw-r--r-- | ifdata.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -64,11 +64,19 @@ struct if_stat { void print_quad_ipv4(unsigned int i) { +#if __BYTE_ORDER == __LITTLE_ENDIAN printf("%d.%d.%d.%d", i&0xff, (i&0xff00)>>8, (i&0xff0000)>>16, (i&0xff000000)>>24); +#else + printf("%d.%d.%d.%d", + (i&0xff000000)>>24, + (i&0xff0000)>>16, + (i&0xff00)>>8, + i&0xff); +#endif } void print_quad_ipv6(uint16_t *a) { |