X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=089d50b23edee2a9d5b6e8a603cb26f88a3c65cd;hb=fe4ad631ada6d1c97bd16abf3ed39f6b25a0c6b6;hp=0b8e8ba9194912f4f63c707949b1f8d6f00e3dbf;hpb=6f0f2b51a2ccb6873d3b2c8ecb075535d2516729;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 0b8e8ba91..089d50b23 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -116,6 +116,15 @@ char *msgkeys[] = { NULL /* Z */ }; +void CtdlMsgSetCM_Fields(struct CtdlMessage *Msg, const char which, const char *buf, long length) +{ + if (Msg->cm_fields[which] != NULL) + free (Msg->cm_fields[which]); + Msg->cm_fields[which] = malloc(length + 1); + memcpy(Msg->cm_fields[which], buf, length); + Msg->cm_fields[which][length] = '\0'; +} + /* * This function is self explanatory. * (What can I say, I'm in a weird mood today...) @@ -1138,7 +1147,7 @@ void mime_download(char *name, char *filename, char *partnum, char *disp, return; } - rv = fwrite(content, length, 1, CC->download_fp); + rv = fwrite(content, length, 1, CCC->download_fp); if (rv <= 0) { MSG_syslog(LOG_EMERG, "mime_download(): Couldn't write: %s\n", strerror(errno));