Skip to content

Commit

Permalink
Ensure atom table index 0 is never used
Browse files Browse the repository at this point in the history
  • Loading branch information
manup committed Jun 7, 2024
1 parent 1f50d07 commit 6e4766c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions atom_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ void AT_Init(unsigned max_atoms)
atom_table[i].len = 0;
atom_table[i].data = 0;
}

atom_table[0].len = 3;
atom_table[0].data = AT_AllocPageData(3); /* allocates also '\0' */;
atom_table[0].data[0] = 'N';
atom_table[0].data[1] = 'U';
atom_table[0].data[2] = 'L';
atom_table[0].data[3] = '\0';
}

void AT_Destroy(void)
Expand Down

0 comments on commit 6e4766c

Please sign in to comment.