*/
cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
if (cdbfr != NULL) {
- msglist = malloc(cdbfr->len);
+ msglist = malloc(cdbfr->len + 1);
if (msglist == NULL) {
syslog(LOG_CRIT, "IMAP: malloc() failed");
CC->kill_me = KILLME_MALLOC_FAILED;
* array.
*/
--Imap->num_msgs;
- memcpy(&Imap->msgids[i],
- &Imap->msgids[i + 1],
- (sizeof(long) *
- (Imap->num_msgs - i)));
- memcpy(&Imap->flags[i],
- &Imap->flags[i + 1],
- (sizeof(long) *
- (Imap->num_msgs - i)));
+ memmove(&Imap->msgids[i],
+ &Imap->msgids[i + 1],
+ (sizeof(long) *
+ (Imap->num_msgs - i)));
+ memmove(&Imap->flags[i],
+ &Imap->flags[i + 1],
+ (sizeof(long) *
+ (Imap->num_msgs - i)));
--i;
}
IAPrintf("* %d RECENT\r\n", num_recent);
}
- if (num_msgs != 0) {
+ if (msglist != NULL) {
free(msglist);
}
Imap->last_mtime = CC->room.QRmtime;
int ra = 0;
struct ctdlroom QRscratch;
int msgs, new;
- int floornum;
- int roomflags;
int i;
/* Convert the supplied folder name to a roomname */
Imap->selected = 0;
return;
}
- floornum = (i & 0x00ff);
- roomflags = (i & 0xff00);
/* First try a regular match */
c = CtdlGetRoom(&QRscratch, towhere);
{
char old_room[ROOMNAMELEN];
char new_room[ROOMNAMELEN];
- int oldr, newr;
+ int newr;
int new_floor;
int r;
struct irl *irl = NULL; /* the list */
return;
}
- oldr = imap_roomname(old_room, sizeof old_room, Params[2].Key);
+ imap_roomname(old_room, sizeof old_room, Params[2].Key);
newr = imap_roomname(new_room, sizeof new_room, Params[3].Key);
new_floor = (newr & 0xFF);
{
struct timeval tv1, tv2;
suseconds_t total_time = 0;
- int untagged_ok = 1;
citimap *Imap;
const char *pchs, *pche;
const imap_handler_hook *h;
* If the command just submitted does not contain a literal, we
* might think about delivering some untagged stuff...
*/
- if (*(ChrPtr(Imap->Cmd.CmdBuf) + StrLength(Imap->Cmd.CmdBuf) - 1)
- == '}') {
- untagged_ok = 0;
- }
/* Grab the tag, command, and parameters. */
imap_parameterize(&Imap->Cmd);