From 87be5f79975d0a3a5d6b7665aafc4be68b4f4afc Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Wed, 24 Jul 2019 16:58:24 +0300
Subject: SL-4150 Rename htonmemcpy

---
 indra/llmessage/lldatapacker.cpp             | 58 +++++++++++++-------------
 indra/llmessage/llmail.cpp                   |  2 +-
 indra/llmessage/llmessagetemplate.cpp        |  2 +-
 indra/llmessage/lltemplatemessagebuilder.cpp |  6 +--
 indra/llmessage/lltemplatemessagereader.cpp  |  6 +--
 indra/llmessage/llxfer.cpp                   |  2 +-
 indra/llmessage/message.h                    | 62 ++++++++++++++--------------
 7 files changed, 69 insertions(+), 69 deletions(-)

(limited to 'indra/llmessage')

diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp
index 3510f93805..6cf6af6437 100644
--- a/indra/llmessage/lldatapacker.cpp
+++ b/indra/llmessage/lldatapacker.cpp
@@ -186,7 +186,7 @@ BOOL LLDataPackerBinaryBuffer::packString(const std::string& value, const char *
 
 	if (mWriteEnabled) 
 	{
-		htonmemcpy(mCurBufferp, value.c_str(), MVT_VARIABLE, length);  
+		htolememcpy(mCurBufferp, value.c_str(), MVT_VARIABLE, length);  
 	}
 	mCurBufferp += length;
 	return success;
@@ -213,12 +213,12 @@ BOOL LLDataPackerBinaryBuffer::packBinaryData(const U8 *value, S32 size, const c
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, &size, MVT_S32, 4);  
+		htolememcpy(mCurBufferp, &size, MVT_S32, 4);  
 	}
 	mCurBufferp += 4;
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, value, MVT_VARIABLE, size);  
+		htolememcpy(mCurBufferp, value, MVT_VARIABLE, size);  
 	}
 	mCurBufferp += size;
 	return success;
@@ -229,12 +229,12 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char
 {
 	BOOL success = TRUE;
 	success &= verifyLength(4, name);
-	htonmemcpy(&size, mCurBufferp, MVT_S32, 4);
+	htolememcpy(&size, mCurBufferp, MVT_S32, 4);
 	mCurBufferp += 4;
 	success &= verifyLength(size, name);
 	if (success)
 	{
-		htonmemcpy(value, mCurBufferp, MVT_VARIABLE, size);
+		htolememcpy(value, mCurBufferp, MVT_VARIABLE, size);
 		mCurBufferp += size;
 	}
 	else
@@ -253,7 +253,7 @@ BOOL LLDataPackerBinaryBuffer::packBinaryDataFixed(const U8 *value, S32 size, co
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, value, MVT_VARIABLE, size);  
+		htolememcpy(mCurBufferp, value, MVT_VARIABLE, size);  
 	}
 	mCurBufferp += size;
 	return success;
@@ -264,7 +264,7 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const
 {
 	BOOL success = TRUE;
 	success &= verifyLength(size, name);
-	htonmemcpy(value, mCurBufferp, MVT_VARIABLE, size);
+	htolememcpy(value, mCurBufferp, MVT_VARIABLE, size);
 	mCurBufferp += size;
 	return success;
 }
@@ -302,7 +302,7 @@ BOOL LLDataPackerBinaryBuffer::packU16(const U16 value, const char *name)
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, &value, MVT_U16, 2);  
+		htolememcpy(mCurBufferp, &value, MVT_U16, 2);  
 	}
 	mCurBufferp += 2;
 	return success;
@@ -314,7 +314,7 @@ BOOL LLDataPackerBinaryBuffer::unpackU16(U16 &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(sizeof(U16), name);
 
-	htonmemcpy(&value, mCurBufferp, MVT_U16, 2);
+	htolememcpy(&value, mCurBufferp, MVT_U16, 2);
 	mCurBufferp += 2;
 	return success;
 }
@@ -327,7 +327,7 @@ BOOL LLDataPackerBinaryBuffer::packU32(const U32 value, const char *name)
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, &value, MVT_U32, 4);  
+		htolememcpy(mCurBufferp, &value, MVT_U32, 4);  
 	}
 	mCurBufferp += 4;
 	return success;
@@ -339,7 +339,7 @@ BOOL LLDataPackerBinaryBuffer::unpackU32(U32 &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(sizeof(U32), name);
 
-	htonmemcpy(&value, mCurBufferp, MVT_U32, 4);
+	htolememcpy(&value, mCurBufferp, MVT_U32, 4);
 	mCurBufferp += 4;
 	return success;
 }
@@ -352,7 +352,7 @@ BOOL LLDataPackerBinaryBuffer::packS32(const S32 value, const char *name)
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, &value, MVT_S32, 4); 
+		htolememcpy(mCurBufferp, &value, MVT_S32, 4); 
 	}
 	mCurBufferp += 4;
 	return success;
@@ -364,7 +364,7 @@ BOOL LLDataPackerBinaryBuffer::unpackS32(S32 &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(sizeof(S32), name);
 
-	htonmemcpy(&value, mCurBufferp, MVT_S32, 4);
+	htolememcpy(&value, mCurBufferp, MVT_S32, 4);
 	mCurBufferp += 4;
 	return success;
 }
@@ -377,7 +377,7 @@ BOOL LLDataPackerBinaryBuffer::packF32(const F32 value, const char *name)
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, &value, MVT_F32, 4); 
+		htolememcpy(mCurBufferp, &value, MVT_F32, 4); 
 	}
 	mCurBufferp += 4;
 	return success;
@@ -389,7 +389,7 @@ BOOL LLDataPackerBinaryBuffer::unpackF32(F32 &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(sizeof(F32), name);
 
-	htonmemcpy(&value, mCurBufferp, MVT_F32, 4);
+	htolememcpy(&value, mCurBufferp, MVT_F32, 4);
 	mCurBufferp += 4;
 	return success;
 }
@@ -402,7 +402,7 @@ BOOL LLDataPackerBinaryBuffer::packColor4(const LLColor4 &value, const char *nam
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, value.mV, MVT_LLVector4, 16); 
+		htolememcpy(mCurBufferp, value.mV, MVT_LLVector4, 16); 
 	}
 	mCurBufferp += 16;
 	return success;
@@ -414,7 +414,7 @@ BOOL LLDataPackerBinaryBuffer::unpackColor4(LLColor4 &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(16, name);
 
-	htonmemcpy(value.mV, mCurBufferp, MVT_LLVector4, 16);
+	htolememcpy(value.mV, mCurBufferp, MVT_LLVector4, 16);
 	mCurBufferp += 16;
 	return success;
 }
@@ -427,7 +427,7 @@ BOOL LLDataPackerBinaryBuffer::packColor4U(const LLColor4U &value, const char *n
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, value.mV, MVT_VARIABLE, 4);  
+		htolememcpy(mCurBufferp, value.mV, MVT_VARIABLE, 4);  
 	}
 	mCurBufferp += 4;
 	return success;
@@ -439,7 +439,7 @@ BOOL LLDataPackerBinaryBuffer::unpackColor4U(LLColor4U &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(4, name);
 
-	htonmemcpy(value.mV, mCurBufferp, MVT_VARIABLE, 4);
+	htolememcpy(value.mV, mCurBufferp, MVT_VARIABLE, 4);
 	mCurBufferp += 4;
 	return success;
 }
@@ -453,8 +453,8 @@ BOOL LLDataPackerBinaryBuffer::packVector2(const LLVector2 &value, const char *n
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, &value.mV[0], MVT_F32, 4);  
-		htonmemcpy(mCurBufferp+4, &value.mV[1], MVT_F32, 4);  
+		htolememcpy(mCurBufferp, &value.mV[0], MVT_F32, 4);  
+		htolememcpy(mCurBufferp+4, &value.mV[1], MVT_F32, 4);  
 	}
 	mCurBufferp += 8;
 	return success;
@@ -466,8 +466,8 @@ BOOL LLDataPackerBinaryBuffer::unpackVector2(LLVector2 &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(8, name);
 
-	htonmemcpy(&value.mV[0], mCurBufferp, MVT_F32, 4);
-	htonmemcpy(&value.mV[1], mCurBufferp+4, MVT_F32, 4);
+	htolememcpy(&value.mV[0], mCurBufferp, MVT_F32, 4);
+	htolememcpy(&value.mV[1], mCurBufferp+4, MVT_F32, 4);
 	mCurBufferp += 8;
 	return success;
 }
@@ -480,7 +480,7 @@ BOOL LLDataPackerBinaryBuffer::packVector3(const LLVector3 &value, const char *n
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, value.mV, MVT_LLVector3, 12);  
+		htolememcpy(mCurBufferp, value.mV, MVT_LLVector3, 12);  
 	}
 	mCurBufferp += 12;
 	return success;
@@ -492,7 +492,7 @@ BOOL LLDataPackerBinaryBuffer::unpackVector3(LLVector3 &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(12, name);
 
-	htonmemcpy(value.mV, mCurBufferp, MVT_LLVector3, 12);
+	htolememcpy(value.mV, mCurBufferp, MVT_LLVector3, 12);
 	mCurBufferp += 12;
 	return success;
 }
@@ -504,7 +504,7 @@ BOOL LLDataPackerBinaryBuffer::packVector4(const LLVector4 &value, const char *n
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, value.mV, MVT_LLVector4, 16);  
+		htolememcpy(mCurBufferp, value.mV, MVT_LLVector4, 16);  
 	}
 	mCurBufferp += 16;
 	return success;
@@ -516,7 +516,7 @@ BOOL LLDataPackerBinaryBuffer::unpackVector4(LLVector4 &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(16, name);
 
-	htonmemcpy(value.mV, mCurBufferp, MVT_LLVector4, 16);
+	htolememcpy(value.mV, mCurBufferp, MVT_LLVector4, 16);
 	mCurBufferp += 16;
 	return success;
 }
@@ -528,7 +528,7 @@ BOOL LLDataPackerBinaryBuffer::packUUID(const LLUUID &value, const char *name)
 
 	if (mWriteEnabled) 
 	{ 
-		htonmemcpy(mCurBufferp, value.mData, MVT_LLUUID, 16);  
+		htolememcpy(mCurBufferp, value.mData, MVT_LLUUID, 16);  
 	}
 	mCurBufferp += 16;
 	return success;
@@ -540,7 +540,7 @@ BOOL LLDataPackerBinaryBuffer::unpackUUID(LLUUID &value, const char *name)
 	BOOL success = TRUE;
 	success &= verifyLength(16, name);
 
-	htonmemcpy(value.mData, mCurBufferp, MVT_LLUUID, 16);
+	htolememcpy(value.mData, mCurBufferp, MVT_LLUUID, 16);
 	mCurBufferp += 16;
 	return success;
 }
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index 134154aa6c..fcda2a85f6 100644
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -373,7 +373,7 @@ std::string LLMail::encryptIMEmailAddress(const LLUUID& from_agent_id,
 	// Convert input data into a binary blob
 	std::vector<U8> data;
 	data.resize(data_size);
-	// *NOTE: This may suffer from endian issues.  Could be htonmemcpy.
+	// *NOTE: This may suffer from endian issues.  Could be htolememcpy.
 	memcpy(&data[0], &time, 4);
 	memcpy(&data[4], &from_agent_id.mData[0], UUID_BYTES);
 	memcpy(&data[4 + UUID_BYTES], &to_agent_id.mData[0], UUID_BYTES);
diff --git a/indra/llmessage/llmessagetemplate.cpp b/indra/llmessage/llmessagetemplate.cpp
index c4c7e66703..e70e259436 100644
--- a/indra/llmessage/llmessagetemplate.cpp
+++ b/indra/llmessage/llmessagetemplate.cpp
@@ -47,7 +47,7 @@ void LLMsgVarData::addData(const void *data, S32 size, EMsgVariableType type, S3
 	{
 		delete[] mData; // Delete it if it already exists
 		mData = new U8[size];
-		htonmemcpy(mData, data, mType, size);
+		htolememcpy(mData, data, mType, size);
 	}
 }
 
diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp
index 8d7c4c0282..5ac5f6c580 100644
--- a/indra/llmessage/lltemplatemessagebuilder.cpp
+++ b/indra/llmessage/lltemplatemessagebuilder.cpp
@@ -689,14 +689,14 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat
 					{
 					case 1:
 						sizeb = size;
-						htonmemcpy(&buffer[result], &sizeb, MVT_U8, 1);
+						htolememcpy(&buffer[result], &sizeb, MVT_U8, 1);
 						break;
 					case 2:
 						sizeh = size;
-						htonmemcpy(&buffer[result], &sizeh, MVT_U16, 2);
+						htolememcpy(&buffer[result], &sizeh, MVT_U16, 2);
 						break;
 					case 4:
-						htonmemcpy(&buffer[result], &size, MVT_S32, 4);
+						htolememcpy(&buffer[result], &size, MVT_S32, 4);
 						break;
 					default:
 						LL_ERRS() << "Attempting to build variable field with unknown size of " << size << LL_ENDL;
diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp
index 4e0c53c37e..6d5ad0ba08 100644
--- a/indra/llmessage/lltemplatemessagereader.cpp
+++ b/indra/llmessage/lltemplatemessagereader.cpp
@@ -645,15 +645,15 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
 						switch(data_size)
 						{
 						case 1:
-							htonmemcpy(&tsizeb, &buffer[decode_pos], MVT_U8, 1);
+							htolememcpy(&tsizeb, &buffer[decode_pos], MVT_U8, 1);
 							tsize = tsizeb;
 							break;
 						case 2:
-							htonmemcpy(&tsizeh, &buffer[decode_pos], MVT_U16, 2);
+							htolememcpy(&tsizeh, &buffer[decode_pos], MVT_U16, 2);
 							tsize = tsizeh;
 							break;
 						case 4:
-							htonmemcpy(&tsize, &buffer[decode_pos], MVT_U32, 4);
+							htolememcpy(&tsize, &buffer[decode_pos], MVT_U32, 4);
 							break;
 						default:
 							LL_ERRS() << "Attempting to read variable field with unknown size of " << data_size << LL_ENDL;
diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp
index c8b9d5d19f..32e0e2cc3b 100644
--- a/indra/llmessage/llxfer.cpp
+++ b/indra/llmessage/llxfer.cpp
@@ -245,7 +245,7 @@ void LLXfer::sendPacket(S32 packet_num)
 				num_copy);
 		}
 		fdata_size += sizeof(S32);
-		htonmemcpy(fdata_buf,&mXferSize, MVT_S32, sizeof(S32));
+		htolememcpy(fdata_buf,&mXferSize, MVT_S32, sizeof(S32));
 	}
 
 	S32 encoded_packetnum = encodePacketNum(packet_num,last_packet);
diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h
index f6c5d9e228..0af5a1b96d 100644
--- a/indra/llmessage/message.h
+++ b/indra/llmessage/message.h
@@ -860,10 +860,10 @@ void null_message_callback(LLMessageSystem *msg, void **data);
 //
 
 #if !defined( LL_BIG_ENDIAN ) && !defined( LL_LITTLE_ENDIAN )
-#error Unknown endianness for htonmemcpy. Did you miss a common include?
+#error Unknown endianness for htolememcpy. Did you miss a common include?
 #endif
 
-static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, size_t n)
+static inline void *htolememcpy(void *vs, const void *vct, EMsgVariableType type, size_t n)
 {
 	char *s = (char *)vs;
 	const char *ct = (const char *)vct;
@@ -886,7 +886,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_S16:
 		if (n != 2)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
 		*(s + 1) = *(ct);
@@ -901,7 +901,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_F32:
 		if (n != 4)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
 		*(s + 3) = *(ct);
@@ -918,7 +918,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_F64:
 		if (n != 8)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
 		*(s + 7) = *(ct);
@@ -938,12 +938,12 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_LLQuaternion:  // We only send x, y, z and infer w (we set x, y, z to ensure that w >= 0)
 		if (n != 12)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
-		htonmemcpy(s + 8, ct + 8, MVT_F32, 4);
-		htonmemcpy(s + 4, ct + 4, MVT_F32, 4);
-		return(htonmemcpy(s, ct, MVT_F32, 4));
+		htolememcpy(s + 8, ct + 8, MVT_F32, 4);
+		htolememcpy(s + 4, ct + 4, MVT_F32, 4);
+		return(htolememcpy(s, ct, MVT_F32, 4));
 #else
 		return(memcpy(s,ct,n));	/* Flawfinder: ignore */ 
 #endif
@@ -951,12 +951,12 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_LLVector3d:
 		if (n != 24)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
-		htonmemcpy(s + 16, ct + 16, MVT_F64, 8);
-		htonmemcpy(s + 8, ct + 8, MVT_F64, 8);
-		return(htonmemcpy(s, ct, MVT_F64, 8));
+		htolememcpy(s + 16, ct + 16, MVT_F64, 8);
+		htolememcpy(s + 8, ct + 8, MVT_F64, 8);
+		return(htolememcpy(s, ct, MVT_F64, 8));
 #else
 		return(memcpy(s,ct,n));	/* Flawfinder: ignore */ 
 #endif
@@ -964,13 +964,13 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_LLVector4:
 		if (n != 16)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
-		htonmemcpy(s + 12, ct + 12, MVT_F32, 4);
-		htonmemcpy(s + 8, ct + 8, MVT_F32, 4);
-		htonmemcpy(s + 4, ct + 4, MVT_F32, 4);
-		return(htonmemcpy(s, ct, MVT_F32, 4));
+		htolememcpy(s + 12, ct + 12, MVT_F32, 4);
+		htolememcpy(s + 8, ct + 8, MVT_F32, 4);
+		htolememcpy(s + 4, ct + 4, MVT_F32, 4);
+		return(htolememcpy(s, ct, MVT_F32, 4));
 #else
 		return(memcpy(s,ct,n));	/* Flawfinder: ignore */ 
 #endif
@@ -978,12 +978,12 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_U16Vec3:
 		if (n != 6)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
-		htonmemcpy(s + 4, ct + 4, MVT_U16, 2);
-		htonmemcpy(s + 2, ct + 2, MVT_U16, 2);
-		return(htonmemcpy(s, ct, MVT_U16, 2));
+		htolememcpy(s + 4, ct + 4, MVT_U16, 2);
+		htolememcpy(s + 2, ct + 2, MVT_U16, 2);
+		return(htolememcpy(s, ct, MVT_U16, 2));
 #else
 		return(memcpy(s,ct,n));	/* Flawfinder: ignore */ 
 #endif
@@ -991,13 +991,13 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_U16Quat:
 		if (n != 8)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
-		htonmemcpy(s + 6, ct + 6, MVT_U16, 2);
-		htonmemcpy(s + 4, ct + 4, MVT_U16, 2);
-		htonmemcpy(s + 2, ct + 2, MVT_U16, 2);
-		return(htonmemcpy(s, ct, MVT_U16, 2));
+		htolememcpy(s + 6, ct + 6, MVT_U16, 2);
+		htolememcpy(s + 4, ct + 4, MVT_U16, 2);
+		htolememcpy(s + 2, ct + 2, MVT_U16, 2);
+		return(htolememcpy(s, ct, MVT_U16, 2));
 #else
 		return(memcpy(s,ct,n));	/* Flawfinder: ignore */ 
 #endif
@@ -1005,15 +1005,15 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 	case MVT_S16Array:
 		if (n % 2)
 		{
-			LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
+			LL_ERRS() << "Size argument passed to htolememcpy doesn't match swizzle type size" << LL_ENDL;
 		}
 #ifdef LL_BIG_ENDIAN
 		length = n % 2;
 		for (i = 1; i < length; i++)
 		{
-			htonmemcpy(s + i*2, ct + i*2, MVT_S16, 2);
+			htolememcpy(s + i*2, ct + i*2, MVT_S16, 2);
 		}
-		return(htonmemcpy(s, ct, MVT_S16, 2));
+		return(htolememcpy(s, ct, MVT_S16, 2));
 #else
 		return(memcpy(s,ct,n));
 #endif
@@ -1025,7 +1025,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
 
 inline void *ntohmemcpy(void *s, const void *ct, EMsgVariableType type, size_t n)
 {
-	return(htonmemcpy(s,ct,type, n));
+	return(htolememcpy(s,ct,type, n));
 }
 
 inline const LLHost& LLMessageSystem::getReceivingInterface() const {return mLastReceivingIF;}
-- 
cgit v1.2.3