From 41d2e7d6b6ac1bab20f73e1e023c8450bbfc657e Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 9 Aug 2019 00:34:26 +0200 Subject: minor corrections --- test-instr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 1b978c55..9107f15e 100644 --- a/test-instr.c +++ b/test-instr.c @@ -20,9 +20,12 @@ int main(int argc, char** argv) { - char buf[8]; + char buff[8]; + char *buf = buff; - if (read(0, buf, sizeof(buf)) < 1) { + if (argc > 1) + buf = argv[1]; + else if (read(0, buf, sizeof(buf)) < 1) { printf("Hum?\n"); exit(1); } -- cgit 1.4.1