Skip to content

Commit

Permalink
Merge pull request OpenEtherCATsociety#614 from notofug/avoid_warnings
Browse files Browse the repository at this point in the history
avoid 'maybe used unitialized' warnings
  • Loading branch information
nakarlsson authored Jun 16, 2022
2 parents 703a6e0 + e604e98 commit 0b8f888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions oshw/linux/oshw.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ec_adaptert * oshw_find_adapters(void)
int i;
struct if_nameindex *ids;
ec_adaptert * adapter;
ec_adaptert * prev_adapter;
ec_adaptert * prev_adapter = NULL;
ec_adaptert * ret_adapter = NULL;


Expand All @@ -60,7 +60,7 @@ ec_adaptert * oshw_find_adapters(void)
* adapter.
* Else save as pointer to return.
*/
if (i)
if (prev_adapter)
{
prev_adapter->next = adapter;
}
Expand Down
3 changes: 2 additions & 1 deletion soem/ethercateoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ int ecx_EOErecv(ecx_contextt *context, uint16 slave, uint8 port, int * psize, vo
NotLast = TRUE;
buffersize = *psize;
rxfragmentno = 0;
rxframeno = 0xff;
rxframeoffset = 0;

/* Hang for a while if nothing is in */
wkc = ecx_mbxreceive(context, slave, (ec_mbxbuft *)&MbxIn, timeout);
Expand All @@ -446,7 +448,6 @@ int ecx_EOErecv(ecx_contextt *context, uint16 slave, uint8 port, int * psize, vo

if (rxfragmentno == 0)
{
rxframeoffset = 0;
rxframeno = EOE_HDR_FRAME_NO_GET(frameinfo2);
rxframesize = (EOE_HDR_FRAME_OFFSET_GET(frameinfo2) << 5);
if (rxframesize > buffersize)
Expand Down

0 comments on commit 0b8f888

Please sign in to comment.