+ buf[1] += static_cast<char>(size);

- buf[1] += size;

~ Warning was triggered by 'size' being std::size_t and lossing data by implicit casting to a narrower type.
  This behavior seems correct, then we can explicit cast it.
This commit is contained in:
Lucas David 2021-07-27 15:39:51 +02:00
parent dad25b0dab
commit 6aa5dba579

View File

@ -194,7 +194,7 @@ namespace crow
buf[0] += opcode; buf[0] += opcode;
if (size < 126) if (size < 126)
{ {
buf[1] += size; buf[1] += static_cast<char>(size);
return {buf, buf+2}; return {buf, buf+2};
} }
else if (size < 0x10000) else if (size < 0x10000)