/*
* If the message doesn't have an EUID, give it one.
*/
- if (msg->cm_fields['E'] == NULL)
+ if (msg->cm_fields[eExclusiveID] == NULL)
{
- char uuid[37];
+ char uuid[SIZ];
generate_uuid(uuid);
- msg->cm_fields['E'] = strdup(uuid);
+ CM_SetField(msg, eExclusiveID, uuid, strlen(uuid));
}
+ /*
+ * We also want to define a maximum length, whether we generated it or not.
+ */
+ CM_CutFieldAt(msg, eExclusiveID, BLOG_EUIDBUF_SIZE - 1);
+
/* Now allow the save to complete. */
return(0);
}