Fix offset calculation: - has a higher precedence than <<.

This commit is contained in:
KAMADA Ken'ichi 2017-07-12 21:36:42 +09:00
parent caafd20aad
commit ad7ccec2f0
1 changed files with 1 additions and 1 deletions

View File

@ -569,7 +569,7 @@ fn write_at<W>(w: &mut W, buf: &[u8], offset: u32)
fn pad_and_get_offset<W>(w: &mut W)
-> Result<u32, Error> where W: Write + Seek {
let mut pos = try!(w.seek(SeekFrom::Current(0)));
if pos >= 1 << 32 - 1 {
if pos >= (1 << 32) - 1 {
return Err(Error::InvalidFormat("Offset too large"));
}
if pos % 2 != 0 {