struct ExpressMessage *ptr, *holdptr;
char *dumpomatic = NULL;
int i;
+ size_t size, size2;
if (CC->FirstExpressMessage == NULL) {
return;
end_critical_section(S_SESSION_TABLE);
while (ptr != NULL) {
- dumpomatic = mallok(strlen(ptr->text) + SIZ);
+ size = strlen(ptr->text) + SIZ;
+ dumpomatic = mallok(size);
strcpy(dumpomatic, "");
if (ptr->flags && EM_BROADCAST)
strcat(dumpomatic, "Broadcast message ");
strcat(dumpomatic, "Please logoff now, as requested ");
else
strcat(dumpomatic, "Message ");
- sprintf(&dumpomatic[strlen(dumpomatic)],
+
+ size2 = strlen(dumpomatic);
+ snprintf(&dumpomatic[size2], size - size2,
"from %s:\n", ptr->sender);
if (ptr->text != NULL)
strcat(dumpomatic, ptr->text);