diff --git a/bld/idebatch/c/tst.c b/bld/idebatch/c/tst.c index fa18a5e60c..b1aed48dfe 100644 --- a/bld/idebatch/c/tst.c +++ b/bld/idebatch/c/tst.c @@ -72,7 +72,7 @@ int main( void ) BatchSpawn( buff ); for( ;; ) { len = BatchCollect( buff, sizeof( buff ), &stat ); - if( len == -1 ) { + if( len < 0 ) { printf( "done: status = %d\n", (int)stat ); break; } else if( kbhit() ) { @@ -81,8 +81,7 @@ int main( void ) } else { BatchCancel(); } - } else if( len != 0 ) { - buff[len] = '\0'; + } else if( len > 0 ) { printf( "%s", buff ); fflush( stdout ); } diff --git a/bld/idebatch/nt/batserv.c b/bld/idebatch/nt/batserv.c index dc5ec9d1f6..6c2ed03afd 100644 --- a/bld/idebatch/nt/batserv.c +++ b/bld/idebatch/nt/batserv.c @@ -111,6 +111,7 @@ static void ProcessConnection( void ) break; /* * add additional null terminate character + * strings are transferred without null terminate character */ bdata.u.s.u.data[len] = '\0'; switch( bdata.u.s.cmd ) {