diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ssh.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ssh.zig b/src/ssh.zig index d8b1fda..549e528 100644 --- a/src/ssh.zig +++ b/src/ssh.zig @@ -62,9 +62,9 @@ pub const Client = struct { } var buffer: [256]u8 = undefined; - var nbytes = ssh.ssh_channel_read(channel, &buffer, buffer.len, 0); - while (nbytes > 0) : (nbytes = ssh.ssh_channel_read(channel, &buffer, buffer.len, 0)) { - var w = try writer.write(buffer[0..@intCast(usize, nbytes)]); + var nbytes: usize = @intCast(ssh.ssh_channel_read(channel, &buffer, buffer.len, 0)); + while (nbytes > 0) : (nbytes = @intCast(ssh.ssh_channel_read(channel, &buffer, buffer.len, 0))) { + var w = try writer.write(buffer[0..nbytes]); if (w != nbytes) { std.os.exit(5); } |