The check is supposed to ensure NULL/empty nodename gets hashed to 0,
but (nodename == '\0') is comparing the pointer itself, not the first
character. So dereference that correctly.
/*
* Get the Hash Key depending on the node name
- * We do not except to have hundreds of nodes yet,
+ * We do not expect to have hundreds of nodes yet,
* This function could be replaced by a better one
* such as a double hash function indexed on type and Node Name
*/
int value;
uint32 hash = 0;
- if (nodename == NULL || nodename == '\0')
+ if (nodename == NULL || *nodename == '\0')
{
return 0;
}