M cmd/sshkey/main.ha => cmd/sshkey/main.ha +2 -1
@@ 1,3 1,4 @@
+use bufio;
use memio;
use encoding::hex;
use encoding::base64;
@@ 38,7 39,7 @@ export fn main() void = {
tty::noecho(&termios)!;
fmt::errorf("Enter passphrase: ")!;
- const pass = memio::scanline(tty)!;
+ const pass = bufio::scanline(tty)!;
tty::termios_restore(&termios);
const pass = match (pass) {
case io::EOF =>
M format/ssh/util.ha => format/ssh/util.ha +1 -0
@@ 1,3 1,4 @@
+use bufio;
use endian;
use io;
use strings;
M net/ssh/proto.ha => net/ssh/proto.ha +3 -5
@@ 6,11 6,9 @@ use strings;
use types;
fn readbyte(src: *memio::stream) (u8 | protoerror) = {
- let b: [1]u8 = [0];
- match (io::read(src, b)!) {
- case let s: size =>
- assert(s == 1);
- return b[0];
+ match (bufio::scanbyte(src)!) {
+ case let b: u8 =>
+ return b;
case io::EOF =>
return protoerror;
};