From b2e22091805b57445a11701f75395fcc3423d523 Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 5 Mar 2020 19:34:28 +0100 Subject: [PATCH] Fix #16142 - missleading wopD error message --- libr/core/cmd_write.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/libr/core/cmd_write.c b/libr/core/cmd_write.c index 531abd45c1ef2..629904d3fcb2f 100644 --- a/libr/core/cmd_write.c +++ b/libr/core/cmd_write.c @@ -421,20 +421,9 @@ static void cmd_write_op (RCore *core, const char *input) { } r_cons_newline (); } else { - while (true) { - int res = r_core_write_at (core, addr, ptr, len); - if (res != 0) { - cmd_write_fail (core); - } - if (res < 1 || len == res) { - break; - } - if (res < len) { - ptr += res; - len -= res; - addr += res; - } - } + if (!r_core_write_at (core, addr, ptr, len)) { + cmd_write_fail (core); + } } free (buf); } else {