summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjulien2023-12-18 18:39:21 +0100
committerjulien2023-12-18 18:39:21 +0100
commit89931542ef3ec877ad17b963358863ec409fedb5 (patch)
tree8c5e4ac18011032f315a88e80c703b79266fb60d /src
parentAdded basic ssh client to run commands (diff)
downloadzigod-89931542ef3ec877ad17b963358863ec409fedb5.tar.gz
zigod-89931542ef3ec877ad17b963358863ec409fedb5.tar.bz2
zigod-89931542ef3ec877ad17b963358863ec409fedb5.zip
zig 0.11 changesHEADmaster
Diffstat (limited to '')
-rw-r--r--src/ssh.zig6
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);
}