From 9e56348975dbdaf1cce9dd688129208a61fd4eb5 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 21 Jul 2017 19:49:56 +0500 Subject: 2017-07-21 --- src/network/Stream.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/network') diff --git a/src/network/Stream.cpp b/src/network/Stream.cpp index 447b13f..2545b48 100644 --- a/src/network/Stream.cpp +++ b/src/network/Stream.cpp @@ -30,11 +30,10 @@ short StreamInput::ReadShort() { } unsigned short StreamInput::ReadUShort() { - unsigned char buff[2]; - ReadData(buff, 2); - unsigned short val = *(reinterpret_cast(buff)); - endswap(val); - return val; + unsigned short value; + ReadData((unsigned char *) &value, 2); + endswap(value); + return value; } int StreamInput::ReadInt() { -- cgit v1.2.3