cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
if (cdbfr != NULL) {
msglist = malloc(cdbfr->len);
- memcpy(msglist, cdbfr->ptr, cdbfr->len);
+ if (msglist == NULL) {
+ lprintf(CTDL_CRIT, "malloc() failed\n");
+ abort();
+ }
+ memcpy(msglist, cdbfr->ptr, (size_t)cdbfr->len);
num_msgs = cdbfr->len / sizeof(long);
cdb_free(cdbfr);
} else {
imap_rescan_msgids();
}
- lprintf(9, "Expunged %d messages.\n", num_expunged);
+ lprintf(CTDL_DEBUG, "Expunged %d messages.\n", num_expunged);
return (num_expunged);
}
char *parms[SIZ];
int num_parms;
- time(&CC->lastcmd);
+ CC->lastcmd = time(NULL);
memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
flush_output();
if (client_gets(cmdbuf) < 1) {
while (strlen(cmdbuf) < 5)
strcat(cmdbuf, " ");
-
/* strip off l/t whitespace and CRLF */
if (cmdbuf[strlen(cmdbuf) - 1] == '\n')
cmdbuf[strlen(cmdbuf) - 1] = 0;
return;
}
-
/* Ok, at this point we're in normal command mode. The first thing
* we do is print any incoming pages (yeah! we really do!)
*/