rem: if (!startAvp)
add: if (startAvp) {  for(avp_t=msg->avpList.head;avp_t&&avp_t!=startAvp;avp_t=avp_t->next); if (!avp_t) { LOG(L_ERR,"ERROR: AAAFindMatchingAVP: the \"position\" avp is not " "in \"avpList\" list!!\n"); goto error; } avp_t=startAvp; } else {
context: AAA_AVP  *AAAFindMatchingAVP(	AAAMessage *msg,	AAA_AVP *startAvp,	AAA_AVPCode avpCode,	AAAVendorId vendorId,	AAASearchType searchType){	AAA_AVP *avp_t;	/* param checking */	if (!msg) {		LOG(L_ERR,"ERROR:FindMatchingAVP: param msg passed null !!\n");		goto error;	}	/* search the startAVP avp */	for(avp_t=msg->avpList.head;avp_t&&avp_t!=startAvp;avp_t=avp_t->next);	if (!avp_t) {		LOG(L_ERR,"ERROR: AAAFindMatchingAVP: the \"position\" avp is not in"			"\"avpList\" list!!\n");		goto error;	}	/* where should I start searching from ? */	if (!startAvp)		avp_t=(searchType==AAA_FORWARD_SEARCH)?(msg->avpList.head):			(msg->avpList.tail);	else		avp_t=startAvp;	/* start searching */	while(avp_t) {		if (avp_t->code==avpCode && avp_t->vendorId==vendorId)			return avp_t;		avp_t = (searchType==AAA_FORWARD_SEARCH)?(avp_t->next):(avp_t->prev);	}error:	return 0;}