@@ -74,27 +74,33 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result)
7474 SNPRINTF (cmd_buf , sizeof (cmd_buf ), "%c%s%s" , 0x0a , cmd , EOM );
7575 barrett_flush (rig );
7676 retval = write_block (rp , (unsigned char * ) cmd_buf , strlen (cmd_buf ));
77+
7778 if (retval < 0 )
7879 {
7980 rig_debug (RIG_DEBUG_ERR , "%s(%d): error in write_block\n" , __func__ , __LINE__ );
8081 return retval ;
8182 }
83+
8284 retval = read_block (RIGPORT (rig ), (unsigned char * ) priv -> ret_data , expected );
8385
8486 if (retval < 0 )
8587 {
8688 rig_debug (RIG_DEBUG_ERR , "%s(%d): error in read_block\n" , __func__ , __LINE__ );
8789 return retval ;
8890 }
89- rig_debug (RIG_DEBUG_VERBOSE , "%s(%d): %d bytes read\n" , __func__ , __LINE__ , retval );
90- if (priv -> ret_data [0 ] == 0x13 ) // we'll return from the 1st good char
91- {
92- * result = & (priv -> ret_data [1 ]);
93- }
94- else // some commands like IAL don't give XOFF but XON is there -- is this a bug?
95- {
96- * result = & (priv -> ret_data [0 ]);
97- }
91+
92+ rig_debug (RIG_DEBUG_VERBOSE , "%s(%d): %d bytes read\n" , __func__ , __LINE__ ,
93+ retval );
94+
95+ if (priv -> ret_data [0 ] == 0x13 ) // we'll return from the 1st good char
96+ {
97+ * result = & (priv -> ret_data [1 ]);
98+ }
99+ else // some commands like IAL don't give XOFF but XON is there -- is this a bug?
100+ {
101+ * result = & (priv -> ret_data [0 ]);
102+ }
103+
98104 return retval ;
99105}
100106
@@ -227,7 +233,7 @@ int barrett_init(RIG *rig)
227233 rig -> caps -> version );
228234 // cppcheck claims leak here but it's freed in cleanup
229235 STATE (rig )-> priv = (struct barrett_priv_data * )calloc (1 ,
230- sizeof (struct barrett_priv_data ));
236+ sizeof (struct barrett_priv_data ));
231237
232238 if (!STATE (rig )-> priv )
233239 {
0 commit comments