mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Simplify read_vchars since it's always stored in little endian.
This commit is contained in:
parent
81bdbaf066
commit
19cbaaf8df
8
runzip.c
8
runzip.c
|
|
@ -65,12 +65,8 @@ static inline i64 read_vchars(rzip_control *control, void *ss, int stream, int l
|
|||
int bytes;
|
||||
i64 s = 0;
|
||||
|
||||
for (bytes = 0; bytes < length; bytes++) {
|
||||
int bits = bytes * 8;
|
||||
|
||||
uchar sb = read_u8(control, ss, stream);
|
||||
s |= (i64)sb << bits;
|
||||
}
|
||||
if (unlikely(read_stream(control, ss, stream, (uchar *)&s, length) != length))
|
||||
fatal("Stream read of %d bytes failed\n", length);
|
||||
s = le64toh(s);
|
||||
return s;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue