This commit is contained in:
Oleksandr Hryshchenko 2021-11-25 23:39:37 +00:00
parent 736137abbe
commit 997d68724f

View File

@ -44,7 +44,7 @@ struct binary* createBinary(char* name){
* @return NULL if the node was not yet added, pointer to the new node if the node was added.
*/
struct binary* productAppend(struct binary* myTree, char* product){
if(!myTree || (myTree->right != NULL && myTree->left != NULL) && (myTree->left->value[0] == '*' && myTree->right->value[0] == '*'))
if(!myTree || ((myTree->right != NULL && myTree->left != NULL) && (myTree->left->value[0] == '*' && myTree->right->value[0] == '*')))
return NULL;
struct binary* itrNode = myTree;
@ -113,6 +113,8 @@ struct binary* questionAppend(struct binary* myTree, char* question){
endingFound = true;
return itrNode2;
}
return NULL;
}