Fixed output of debug data when a debug message doesn't contain a newline

This commit is contained in:
Mark Pizzolato 2013-04-17 06:15:52 -07:00
parent ed7f3be258
commit df93215acf

10
scp.c
View file

@ -6672,8 +6672,14 @@ if (sim_deb && (dptr->dctrl & dbits)) {
j = i + 1; j = i + 1;
} }
} }
if (i > j) if (i > j) {
fwrite (&buf[j], 1, i-j, sim_deb); 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 */ /* Set unterminated flag for next time */