From 0313638f26ac9ef314152f0bb7ef95fa01c0e8d7 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Tue, 10 Sep 2024 09:18:46 +0200 Subject: [PATCH] trap: cleanup par trap code improve handling of errors source code formatting changes --- bld/trap/par/c/parlink.c | 3 +++ bld/trap/par/c/parproc.c | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bld/trap/par/c/parlink.c b/bld/trap/par/c/parlink.c index 200b5f269b..44cbc1dbc9 100644 --- a/bld/trap/par/c/parlink.c +++ b/bld/trap/par/c/parlink.c @@ -199,6 +199,9 @@ const char *RemoteLinkSet( const char *parms ) port <<= 4; port += ch; } + if( port == 0 ) { + return( InvalidPort ); + } } else { return( InvalidPort ); } diff --git a/bld/trap/par/c/parproc.c b/bld/trap/par/c/parproc.c index 56d5644b07..581a875bff 100644 --- a/bld/trap/par/c/parproc.c +++ b/bld/trap/par/c/parproc.c @@ -420,8 +420,8 @@ static int DataGetByte( hw_data *hwd, unsigned long wait ) static unsigned DataGet( hw_data *hwd, char *data, unsigned len ) { - unsigned get_len; - unsigned i; + unsigned get_len; + unsigned i; char c; get_len = DataGetByte( hwd, RELINQUISH ); @@ -528,7 +528,7 @@ static int DataPutByte( hw_data *hwd, unsigned char data, unsigned long wait ) static unsigned DataPut( hw_data *hwd, char *data, unsigned len ) { - unsigned count; + unsigned count; if( len >= 0x80 ) { DataPutByte( hwd, (len >> 8) | 0x80, RELINQUISH ); @@ -580,7 +580,7 @@ static bool CountTwidle( hw_data *hwd ) char buf[10]; itoa( type, buf, 16 ); - cputs( " Type " ); cputs( buf ); + dbgrtn( " Type " ); dbgrtn( buf ); } #endif #endif @@ -766,4 +766,3 @@ static void DataDisconnect( hw_data *hwd ) { /* delay while other side catches up */ } DataReset( hwd, true ); } -