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;
|
int bytes;
|
||||||
i64 s = 0;
|
i64 s = 0;
|
||||||
|
|
||||||
for (bytes = 0; bytes < length; bytes++) {
|
if (unlikely(read_stream(control, ss, stream, (uchar *)&s, length) != length))
|
||||||
int bits = bytes * 8;
|
fatal("Stream read of %d bytes failed\n", length);
|
||||||
|
|
||||||
uchar sb = read_u8(control, ss, stream);
|
|
||||||
s |= (i64)sb << bits;
|
|
||||||
}
|
|
||||||
s = le64toh(s);
|
s = le64toh(s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue