diff options
author | julien | 2023-12-18 18:39:21 +0100 |
---|---|---|
committer | julien | 2023-12-18 18:39:21 +0100 |
commit | 89931542ef3ec877ad17b963358863ec409fedb5 (patch) | |
tree | 8c5e4ac18011032f315a88e80c703b79266fb60d /src | |
parent | Added basic ssh client to run commands (diff) | |
download | zigod-master.tar.gz zigod-master.tar.bz2 zigod-master.zip |
Diffstat (limited to '')
-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); } |