diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-07-21 16:49:56 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-07-21 16:49:56 +0200 |
commit | 9e56348975dbdaf1cce9dd688129208a61fd4eb5 (patch) | |
tree | 5a44a37cf0243c1ced14c222f35983eaaaa0185b /src/network | |
parent | 2017-06-21 (diff) | |
download | AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.gz AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.bz2 AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.lz AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.xz AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.zst AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.zip |
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/Stream.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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<unsigned short *>(buff)); - endswap(val); - return val; + unsigned short value; + ReadData((unsigned char *) &value, 2); + endswap(value); + return value; } int StreamInput::ReadInt() { |