fix mistakes introduced in b883bc8

This commit is contained in:
Andrew Kelley 2018-12-13 06:07:39 -05:00
parent 7417f2e4b3
commit 6395cf8d6b
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 2 additions and 2 deletions

View File

@ -5313,7 +5313,7 @@ comptime {
{#header_close#}
{#header_open|@bswap#}
<pre>{#syntax#}@swap(comptime T: type, value: T) T{#endsyntax#}</pre>
<pre>{#syntax#}@bswap(comptime T: type, value: T) T{#endsyntax#}</pre>
<p>{#syntax#}T{#endsyntax#} must be an integer type with bit count evenly divisible by 8.</p>
<p>
Swaps the byte order of the integer. This converts a big endian integer to a little endian integer,

View File

@ -186,7 +186,7 @@ pub fn InStream(comptime ReadError: type) type {
pub fn readVarInt(self: *Self, comptime T: type, endian: builtin.Endian, size: usize) !T {
assert(size <= @sizeOf(T));
var bytes: [@sizeOf(T)]u8 = undefined;
try self.readNoEof(bytes[0..]);
try self.readNoEof(bytes[0..size]);
return mem.readIntSlice(T, bytes, endian);
}