fix(BinaryWriter): warning due to implicit cast

This commit is contained in:
Günter Obiltschnig 2024-04-03 07:12:03 +02:00
parent a25cdac549
commit 4892d97f51

View File

@ -336,7 +336,7 @@ void BinaryWriter::writeRaw(const char* buffer, std::streamsize length)
void BinaryWriter::writeCString(const char* cString, std::streamsize maxLength) void BinaryWriter::writeCString(const char* cString, std::streamsize maxLength)
{ {
const std::size_t len = ::strnlen(cString, maxLength); const std::size_t len = ::strnlen(cString, static_cast<std::size_t>(maxLength));
writeRaw(cString, len); writeRaw(cString, len);
static const char zero = '\0'; static const char zero = '\0';
_ostr.write(&zero, sizeof(zero)); _ostr.write(&zero, sizeof(zero));