From df93215acfbf0c657828090b9b7fdc978c65863a Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 17 Apr 2013 06:15:52 -0700 Subject: [PATCH] Fixed output of debug data when a debug message doesn't contain a newline --- scp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index 99ca6cd5..83237b2b 100644 --- a/scp.c +++ b/scp.c @@ -6672,8 +6672,14 @@ if (sim_deb && (dptr->dctrl & dbits)) { j = i + 1; } } - if (i > j) - fwrite (&buf[j], 1, i-j, sim_deb); + if (i > j) { + if (debug_unterm) + fprintf (sim_deb, "%.*s", i-j, &buf[j]); + else /* print prefix when required */ + fprintf (sim_deb, "DBG(%.0f)%s> %s %s: %.*s", sim_gtime(), + AIO_MAIN_THREAD ? "" : "+", + dptr->name, debug_type, i-j, &buf[j]); + } /* Set unterminated flag for next time */