Skip to content

Commit

Permalink
idebatch: BatchCollect returns strings which are null terminated now
Browse files Browse the repository at this point in the history
update comment
  • Loading branch information
jmalak committed Aug 14, 2024
1 parent 5ea8f6b commit cee8ba2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bld/idebatch/c/tst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand All @@ -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 );
}
Expand Down
1 change: 1 addition & 0 deletions bld/idebatch/nt/batserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit cee8ba2

Please sign in to comment.