$Log$
+ Revision 605.11 2003/03/10 03:40:08 ajc
+ * Fixed bug that caused segv when <R>eplying to certain messages
+
Revision 605.10 2003/03/07 17:39:45 ajc
* Remove the "modules" directory
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
int CtdlIPCPostMessage(CtdlIPC *ipc, int flag, const struct ctdlipcmessage *mr, char *cret)
{
register int ret;
- char *aaa;
+ char cmd[SIZ];
if (!cret) return -2;
if (!mr) return -2;
- aaa = (char *)malloc(strlen(mr->recipient) + strlen(mr->author) + 40);
- if (!aaa) return -1;
-
- sprintf(aaa, "ENT0 %d|%s|%d|%d|%s|%s", flag, mr->recipient,
+ snprintf(cmd, sizeof cmd,
+ "ENT0 %d|%s|%d|%d|%s|%s", flag, mr->recipient,
mr->anonymous, mr->type, mr->subject, mr->author);
- ret = CtdlIPCGenericCommand(ipc, aaa, mr->text, strlen(mr->text), NULL,
+ ret = CtdlIPCGenericCommand(ipc, cmd, mr->text, strlen(mr->text), NULL,
NULL, cret);
- free(aaa);
return ret;
}