From d7130234d3c3eaf773a1dc306ed94e3a234bcaeb Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Mon, 17 Aug 2015 19:48:45 +0200 Subject: [PATCH] Return script buffer without copying. * Since IDE interrupts are enabled after compiling the script, we can just return a pointer to the script buffer without copying it first. --- src/omv/usbdbg.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/omv/usbdbg.c b/src/omv/usbdbg.c index a8d85c13b..f93963fcb 100644 --- a/src/omv/usbdbg.c +++ b/src/omv/usbdbg.c @@ -48,10 +48,7 @@ int usbdbg_script_ready() vstr_t *usbdbg_get_script() { - vstr_t *scr = vstr_new(); - vstr_add_strn(scr, vstr_str(&script_buf), vstr_len(&script_buf)); - vstr_reset(&script_buf); - return scr; + return &script_buf; } void usbdbg_clear_flags()