if (element_len > 10) return -1;
int decode_entityid(unsigned char *element, int element_len) {	// 0x02 Entity ID   if (element_len > 10) return -1;	if (element_len > 5) {   		memcpy(entity_call, element, 6);		entity_call[6]=0;		entity_ssid = extract_ssid(entity_call);	}	else {		strcpy(entity_call, origin_call);	}	switch (element_len) {		case 0:			entity_serial++;			entity_sequence = 0;			break;		case 2:			entity_serial = get16(element);			entity_sequence = 0;			break;		case 4:			entity_serial = get16(element);			entity_sequence = get16(element+2);			break;		case 6:			entity_serial = 0;			break;		case 8:			entity_serial = get16(element+6);			entity_sequence = 0;			break;		case 10:			entity_serial = get16(element+6);			entity_sequence = get16(element+8);			break;		default:			return -1;	}	lprintf(T_OPENTRAC, "Entity %s-%d:%04x #%d\r\n", entity_call, entity_ssid, entity_serial, entity_sequence);	return 0;}