From 8a924da586e9d60d85d61946251a22411269bd4c Mon Sep 17 00:00:00 2001 From: Natt Akuma Date: Mon, 7 Mar 2022 18:55:25 +0700 Subject: [PATCH] Fix narrowing conversion error --- src/engine/safeWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }