summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5f48615)
raw | patch | inline | side by side (parent: 5f48615)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 24 Dec 2014 15:49:55 +0000 (16:49 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 24 Dec 2014 15:49:55 +0000 (16:49 +0100) |
D'oh!
src/utils/proto.c | patch | blob | history |
diff --git a/src/utils/proto.c b/src/utils/proto.c
index f543dd665cab71b56fe97f0f8f767ead5dfbc6e6..5a7a2e31fe0ae83c96b6654e138fd578de0a6697 100644 (file)
--- a/src/utils/proto.c
+++ b/src/utils/proto.c
{
if (buf_len >= sizeof(v)) {
#if __BYTE_ORDER != __BIG_ENDIAN
- v = (((int64_t)ntohl((int32_t)v)) << 32)
- + ((int64_t)ntohl((int32_t)(v >> 32)));
+ v = (((int64_t)htonl((int32_t)v)) << 32)
+ + ((int64_t)htonl((int32_t)(v >> 32)));
#endif
memcpy(buf, &v, sizeof(v));
}
assert(sizeof(v) == sizeof(t));
memcpy(&t, &v, sizeof(v));
#if IEEE754_DOUBLE_BYTE_ORDER != IEEE754_DOUBLE_BIG_ENDIAN
- t = (((int64_t)ntohl((int32_t)t)) << 32)
- + ((int64_t)ntohl((int32_t)(t >> 32)));
+ t = (((int64_t)htonl((int32_t)t)) << 32)
+ + ((int64_t)htonl((int32_t)(t >> 32)));
#endif
if (buf_len >= sizeof(t))
memcpy(buf, &t, sizeof(t));