forked from auracaster/openocd
alloc_printf and alloc_vprintf
git-svn-id: svn://svn.berlios.de/openocd/trunk@465 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -267,7 +267,7 @@ void command_print_n(command_context_t *context, char *format, ...)
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
||||
string = alloc_printf(format, ap);
|
||||
string = alloc_vprintf(format, ap);
|
||||
if (string != NULL)
|
||||
{
|
||||
context->output_handler(context, string);
|
||||
@@ -284,10 +284,10 @@ void command_print(command_context_t *context, char *format, ...)
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
||||
string = alloc_printf(format, ap);
|
||||
string = alloc_vprintf(format, ap);
|
||||
if (string != NULL)
|
||||
{
|
||||
strcat(string, "\n"); /* alloc_printf guaranteed the buffer to be at least one char longer */
|
||||
strcat(string, "\n"); /* alloc_vprintf guaranteed the buffer to be at least one char longer */
|
||||
context->output_handler(context, string);
|
||||
free(string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user