Skip to content

Commit

Permalink
Issue #37: Fix problems caused by an uninitialized memory
Browse files Browse the repository at this point in the history
  • Loading branch information
gotthardp committed Nov 29, 2018
1 parent 5964b3b commit dd14a66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mercury.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ typedef struct {
PyObject_HEAD
/* Type-specific fields go here. */
TMR_Reader reader;
TMR_TagOp tagop;
uint8_t antennas[MAX_ANTENNA_COUNT];
TMR_ReadListenerBlock readListener;
PyObject *readCallback;
Expand Down Expand Up @@ -345,7 +346,6 @@ Reader_set_read_plan(Reader *self, PyObject *args, PyObject *kwds)
if (bank != NULL)
{
int op = 0;
TMR_TagOp tagop;

if(PyList_Check(bank))
{
Expand All @@ -365,10 +365,10 @@ Reader_set_read_plan(Reader *self, PyObject *args, PyObject *kwds)
return NULL;
}

if ((ret = TMR_TagOp_init_GEN2_ReadData(&tagop, op, 0, 0)) != TMR_SUCCESS)
if ((ret = TMR_TagOp_init_GEN2_ReadData(&self->tagop, op, 0, 0)) != TMR_SUCCESS)
goto fail;

if ((ret = TMR_RP_set_tagop(&plan, &tagop)) != TMR_SUCCESS)
if ((ret = TMR_RP_set_tagop(&plan, &self->tagop)) != TMR_SUCCESS)
goto fail;
}

Expand Down

0 comments on commit dd14a66

Please sign in to comment.