Merge branch 'dsp5680xx_cherry' of git://repo.or.cz/openocd/dsp568013 into HEAD
[fw/openocd] / src / helper / command.c
index d5ac34b490f9206d2bb11bf827f57bcd5e9d91c1..b00a231268cb7fb77f47a2c7dc6b7261e0707e31 100644 (file)
@@ -676,7 +676,7 @@ int command_run_line(struct command_context *context, char *line)
                {
                        /* We do not print the connection closed error message */
                        Jim_MakeErrorMessage(interp);
-                       LOG_USER_N("%s\n", Jim_GetString(Jim_GetResult(interp), NULL));
+                       LOG_USER("%s", Jim_GetString(Jim_GetResult(interp), NULL));
                }
                if (retval == ERROR_OK)
                {
@@ -706,7 +706,7 @@ int command_run_line(struct command_context *context, char *line)
                                buff[chunk] = 0;
                                LOG_USER_N("%s", buff);
                        }
-                       LOG_USER_N("%s", "\n");
+                       LOG_USER_N("\n");
                }
                retval = ERROR_OK;
        }
@@ -723,6 +723,7 @@ int command_run_linef(struct command_context *context, const char *format, ...)
        if (string != NULL)
        {
                retval = command_run_line(context, string);
+               free(string);
        }
        va_end(ap);
        return retval;
@@ -860,8 +861,7 @@ static void command_help_show_wrap(const char *str, unsigned n, unsigned n2)
                if (next - last < HELP_LINE_WIDTH(n))
                        cp = next;
                command_help_show_indent(n);
-               LOG_USER_N("%.*s", (int)(cp - last), last);
-               LOG_USER_N("\n");
+               LOG_USER("%.*s", (int)(cp - last), last);
                last = cp + 1;
                n = n2;
        }