mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed usize size issue for 32-bit platforms
This commit is contained in:
parent
3285fc9b88
commit
c445e76afa
@ -267,9 +267,9 @@ impl<S: PostMsg, R: PostMsg> PostBox<S, R> {
|
||||
for _ in 0..100 {
|
||||
match incoming_buf.get(0..9) {
|
||||
Some(len_bytes) => {
|
||||
let len = usize::from_le_bytes(
|
||||
let len = u64::from_le_bytes(
|
||||
<[u8; 8]>::try_from(&len_bytes[0..8]).unwrap(),
|
||||
); // Can't fail
|
||||
) as usize; // Can't fail
|
||||
|
||||
if len > MAX_MSG_SIZE {
|
||||
recv_tx.send(Err(Error::InvalidMessage)).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user