summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gruno <humbedooh@apache.org>2013-09-18 09:48:22 +0200
committerDaniel Gruno <humbedooh@apache.org>2013-09-18 09:48:22 +0200
commite9ed2c0311a7032ba29071ce1c2a063323f5e39b (patch)
treefa5aabb82298bbb0c3d7c3d3b4749da290bc7136
parentrebuild (diff)
downloadapache2-e9ed2c0311a7032ba29071ce1c2a063323f5e39b.tar.xz
apache2-e9ed2c0311a7032ba29071ce1c2a063323f5e39b.zip
mod_lua: ap_ntoh64 endianess test
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524321 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/lua/lua_request.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c
index 392554b813..d8e62937d5 100644
--- a/modules/lua/lua_request.c
+++ b/modules/lua/lua_request.c
@@ -1933,7 +1933,10 @@ static apr_uint64_t ap_ntoh64(const apr_uint64_t *input)
{
apr_uint64_t rval;
unsigned char *data = (unsigned char *)&rval;
-
+ if (APR_IS_BIGENDIAN) {
+ return *input;
+ }
+
data[0] = *input >> 56;
data[1] = *input >> 48;
data[2] = *input >> 40;