Make adding an identical error symbol not fail
A test case was also added which test that adding an error symbol with same error code and message as one added before will not fail
This commit is contained in:
@@ -105,7 +105,12 @@ int errSymbolAdd(long errNum, const char *name)
|
||||
/* search for last node (NULL) of hashnode linked list */
|
||||
while (pNextNode) {
|
||||
if (pNextNode->errNum == errNum) {
|
||||
return S_err_codeExists;
|
||||
if(strcmp(name, pNextNode->message)) {
|
||||
return S_err_codeExists;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
phashnode = &pNextNode->hashnode;
|
||||
pNextNode = *phashnode;
|
||||
|
||||
Reference in New Issue
Block a user