Fix debug output on the console.

Check if there's a \n at the end, if not, append one. Before, it checked for a
\n anywhere in the string, and if there was, wouldn't append one.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@11638 4a71c877-e1ca-e34f-864e-861f7616d084
master
Christian Ohm 2010-09-07 23:18:53 +00:00 committed by Git SVN Gateway
parent 8c79885bc7
commit fadd32b1e6
1 changed files with 1 additions and 1 deletions

View File

@ -118,7 +118,7 @@ static code_part code_part_from_str(const char *str)
*/
void debug_callback_stderr( WZ_DECL_UNUSED void ** data, const char * outputBuffer )
{
if ( !strchr( outputBuffer, '\n' ) ) {
if ( outputBuffer[strlen(outputBuffer) - 1] != '\n' ) {
fprintf( stderr, "%s\n", outputBuffer );
} else {
fprintf( stderr, "%s", outputBuffer );