summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-05-10 16:28:49 +0200
committerJo-Philipp Wich <jo@mein.io>2021-05-10 16:31:50 +0200
commit0cb10c62a0d663fe42cebb4134e7cfcd3c461156 (patch)
tree51decb6c88de07fa9c8bb5d31491b47ff781d741 /lib.c
parenteb8a64d461851756e65093edf923bd534e86aae5 (diff)
vm: implement mechanism to change output file descriptor
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index c1583f9..9d8241b 100644
--- a/lib.c
+++ b/lib.c
@@ -292,7 +292,7 @@ uc_print_common(uc_vm *vm, size_t nargs, FILE *fh)
static uc_value_t *
uc_print(uc_vm *vm, size_t nargs)
{
- return uc_print_common(vm, nargs, stdout);
+ return uc_print_common(vm, nargs, vm->output);
}
static uc_value_t *
@@ -1495,7 +1495,7 @@ uc_printf(uc_vm *vm, size_t nargs)
uc_printf_common(vm, nargs, buf);
- len = fwrite(buf->buf, 1, printbuf_length(buf), stdout);
+ len = fwrite(buf->buf, 1, printbuf_length(buf), vm->output);
printbuf_free(buf);