Commit 8c32c09807

Euan Torano <euantorano@gmail.com>
2019-08-05 20:18:19
Fix InStream.readNoEof
1 parent c175e53
Changed files (1)
std
std/io.zig
@@ -146,7 +146,7 @@ pub fn InStream(comptime ReadError: type) type {
 
         /// Same as `readFull` but end of stream returns `error.EndOfStream`.
         pub fn readNoEof(self: *Self, buf: []u8) !void {
-            const amt_read = try self.read(buf);
+            const amt_read = try self.readFull(buf);
             if (amt_read < buf.len) return error.EndOfStream;
         }