- if ( (strlen(msg->cm_fields[eExclusiveID]) >= 9)
- && (!strcasecmp(&msg->cm_fields[eExclusiveID][strlen(msg->cm_fields[eExclusiveID])-9], "_HISTORY_"))
+ if ( (msg->cm_lengths[eExclusiveID] >= 9)
+ && (!strcasecmp(&msg->cm_fields[eExclusiveID][msg->cm_lengths[eExclusiveID]-9], "_HISTORY_"))