Skip to content

Commit

Permalink
fix SPRK table allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
gardner48 committed May 12, 2024
1 parent b060541 commit 42240b6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/arkode/arkode_sprk.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,15 @@ ARKodeSPRKTable ARKodeSymplecticSofroniou10(void)
ARKodeSPRKTable ARKodeSPRKTable_Create(int s, int q, const sunrealtype* a,
const sunrealtype* ahat)
{
int i = 0;
ARKodeSPRKTable sprk_table = NULL;
if (s < 1 || !a || !ahat) { return NULL; }

sprk_table = (ARKodeSPRKTable)malloc(sizeof(struct ARKodeSPRKTableMem));
ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(s);
if (!sprk_table) { return NULL; }

sprk_table->stages = s;
sprk_table->q = q;

for (i = 0; i < s; i++)
for (int i = 0; i < s; i++)
{
sprk_table->a[i] = a[i];
sprk_table->ahat[i] = ahat[i];
Expand Down

0 comments on commit 42240b6

Please sign in to comment.