summaryrefslogtreecommitdiffstats
path: root/src/network/Stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/Stream.cpp')
-rw-r--r--src/network/Stream.cpp9
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() {