ノード構造のリンクリストがあり、リストを検索して一致するIDを持つノードを見つけるための関数で、渡されたIDとノードIDを比較するとifステートメントが失敗するようです。ifステートメントは、以下の関数の6行目にあります。* node_id *とidの両方が同じ値であっても、失敗します。
NODE *node_id_search(int id, NODE *start) {
NODE *result = NULL, *current = start;
do {
if(current->node_id == id) {
result == current;
}
current = current->next;
} while(current->next != NULL && result == NULL);
return result;
}
node.h
typedef struct node {
/*@{*/
/**
* The node id used to identify the node. The id is a positive integer.
*/
int node_id;
/**
* The node type.
*/
char node_type[10];
/**
* Pointer to the next node element.
*/
struct node *next;
/*@}*/
} NODE;