diff --git a/src/engine/safeWriter.cpp b/src/engine/safeWriter.cpp index 7b6f0b1e5..f29800a4a 100644 --- a/src/engine/safeWriter.cpp +++ b/src/engine/safeWriter.cpp @@ -81,7 +81,7 @@ int SafeWriter::writeS(short val) { return write(&val,2); } int SafeWriter::writeS_BE(short val) { - unsigned char bytes[2]{(val>>8)&0xff, val&0xff}; + unsigned char bytes[2]{(unsigned char)((val>>8)&0xff), (unsigned char)(val&0xff)}; return write(bytes,2); }