mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
Avoid sign-extending unsigned VarInts
This commit is contained in:
parent
b8d747fe51
commit
363821a545
1 changed files with 7 additions and 1 deletions
|
|
@ -654,7 +654,13 @@ impl SendPropValue {
|
|||
SendPropParseDefinition::NormalVarInt { unsigned, .. } => {
|
||||
read_var_int(stream, !*unsigned)
|
||||
.map_err(ParseError::from)
|
||||
.map(|int| int as i64)
|
||||
.map(|int| {
|
||||
if *unsigned {
|
||||
int as u32 as i64
|
||||
} else {
|
||||
int as i64
|
||||
}
|
||||
})
|
||||
.map(SendPropValue::from)
|
||||
}
|
||||
SendPropParseDefinition::UnsignedInt { bit_count, .. } => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue