Skip to content

Commit

Permalink
fix c code
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Jun 25, 2024
1 parent 3c64f6a commit 32351db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/asammdf/blocks/cutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ static PyObject *data_block_from_arrays(PyObject *self, PyObject *args)
char *outptr;
char *read_pos = NULL, *write_pos = NULL;
int64_t total_size = 0, record_size = 0,
cycles;
cycles, step = 0;
int64_t isize = 0, offset = 0;

struct dtype *block_info = NULL;
Expand Down Expand Up @@ -1368,6 +1368,7 @@ static PyObject *data_block_from_arrays(PyObject *self, PyObject *args)
read_pos = block_info[j].data;
write_pos = outptr + offset;
isize = block_info[j].itemsize;
step = record_size - isize;

for (
int i = 0;
Expand All @@ -1376,6 +1377,7 @@ static PyObject *data_block_from_arrays(PyObject *self, PyObject *args)
{
for (int k = 0; k < isize; k++)
*write_pos++ = *read_pos++;
write_pos += step;
}
}
}
Expand Down

0 comments on commit 32351db

Please sign in to comment.