Well, right now for testing purposes I haven't implemented adding anything past one name, and SymEntry->Next should be NULL terminated for that one.
Code:
bool EnterName(struct SymTab *ATable, const char *Name,
struct SymEntry * *AnEntry) {
int hashValue = hash(Name,ATable);
char n[200];
int nameLength;
struct SymEntry *currentEntry;
strcpy(n, Name);
nameLength = strlen(n) + 1;
if(ATable->Contents[hashValue] == NULL) {
currentEntry = (struct SymEntry*)malloc(sizeof(struct SymEntry*) + nameLength);
currentEntry->Name = n;
currentEntry->Next = NULL;
ATable->Contents[hashValue] = currentEntry;
AnEntry = ¤tEntry;
return false;
}
return true;
};
I think it shouldn't even touch that second while loop?... maybe I should comment it out and see if it makes a difference.