mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 10:14:06 +02:00
fix signed varint encoding
This commit is contained in:
parent
00596f946f
commit
60f23647c5
1 changed files with 1 additions and 1 deletions
|
|
@ -1107,7 +1107,7 @@ pub fn write_var_int(
|
|||
signed: bool,
|
||||
) -> ReadResult<()> {
|
||||
let abs = if signed {
|
||||
let int = (int << 1) ^ -(int & 1);
|
||||
let int = (int << 1) ^ (int >> 31);
|
||||
u32::from_le_bytes(int.to_le_bytes())
|
||||
} else {
|
||||
int as u32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue