zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 6395cf8d6b2cf585214a284039c16d6dc5ef5de3 (tree)
parent 7417f2e4b3a9c21249bac38688ef453c6b86acfa
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu, 13 Dec 2018 06:07:39 -0500

fix mistakes introduced in b883bc8

Diffstat:
Mdoc/langref.html.in | 2+-
Mstd/io.zig | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/langref.html.in b/doc/langref.html.in @@ -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, diff --git a/std/io.zig b/std/io.zig @@ -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); }