mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 04:24:33 +01:00
Fix logic for detecting zero buffer capacity in fileReadStreamingWindows/fileReadPositionalWindows
This commit is contained in:
parent
eb29737d5d
commit
58f0c8cfed
1 changed files with 4 additions and 4 deletions
|
|
@ -6780,8 +6780,8 @@ fn fileReadStreamingWindows(userdata: ?*anyopaque, file: File, data: []const []u
|
|||
|
||||
const DWORD = windows.DWORD;
|
||||
var index: usize = 0;
|
||||
while (data[index].len == 0) index += 1;
|
||||
if (index == 0) return 0;
|
||||
while (index < data.len and data[index].len == 0) index += 1;
|
||||
if (index == data.len) return 0;
|
||||
const buffer = data[index];
|
||||
const want_read_count: DWORD = @min(std.math.maxInt(DWORD), buffer.len);
|
||||
|
||||
|
|
@ -6912,8 +6912,8 @@ fn fileReadPositionalWindows(userdata: ?*anyopaque, file: File, data: []const []
|
|||
const DWORD = windows.DWORD;
|
||||
|
||||
var index: usize = 0;
|
||||
while (data[index].len == 0) index += 1;
|
||||
if (index == 0) return 0;
|
||||
while (index < data.len and data[index].len == 0) index += 1;
|
||||
if (index == data.len) return 0;
|
||||
const buffer = data[index];
|
||||
const want_read_count: DWORD = @min(std.math.maxInt(DWORD), buffer.len);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue