IMAP_LIST* list;
IMAP_LIST lb;
char delimbuf[5]; /* worst case: "\\"\0 */
- long litlen;
+ unsigned int litlen;
if (idata->cmddata && idata->cmdtype == IMAP_CT_LIST)
list = (IMAP_LIST*)idata->cmddata;
unsigned int count;
IMAP_STATUS *status;
unsigned int olduv, oldun;
- long litlen;
+ unsigned int litlen;
short new = 0;
short new_msg_count = 0;
/* imap_read_literal: read bytes bytes from server into file. Not explicitly
* buffered, relies on FILE buffering. NOTE: strips \r from \r\n.
* Apparently even literals use \r\n-terminated strings ?! */
-int imap_read_literal (FILE* fp, IMAP_DATA* idata, long bytes, progress_t* pbar)
+int imap_read_literal (FILE* fp, IMAP_DATA* idata, unsigned int bytes, progress_t* pbar)
{
- long pos;
+ unsigned int pos;
char c;
int r = 0;
int imap_open_connection (IMAP_DATA* idata);
void imap_close_connection (IMAP_DATA* idata);
IMAP_DATA* imap_conn_find (const ACCOUNT* account, int flags);
-int imap_read_literal (FILE* fp, IMAP_DATA* idata, long bytes, progress_t*);
+int imap_read_literal (FILE* fp, IMAP_DATA* idata, unsigned int bytes, progress_t*);
void imap_expunge_mailbox (IMAP_DATA* idata);
void imap_logout (IMAP_DATA** idata);
int imap_sync_message_for_copy (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd,
size_t plen);
void imap_cachepath(IMAP_DATA* idata, const char* mailbox, char* dest,
size_t dlen);
-int imap_get_literal_count (const char* buf, long* bytes);
+int imap_get_literal_count (const char* buf, unsigned int* bytes);
char* imap_get_qualifier (char* buf);
int imap_mxcmp (const char* mx1, const char* mx2);
char* imap_next_word (char* s);
char buf[LONG_STRING];
char path[_POSIX_PATH_MAX];
char *pc;
- long bytes;
+ unsigned int bytes;
progress_t progressbar;
unsigned int uid;
int cacheno;
static int msg_fetch_header (CONTEXT* ctx, IMAP_HEADER* h, char* buf, FILE* fp)
{
IMAP_DATA* idata;
- long bytes;
+ unsigned int bytes;
int rc = -1; /* default now is that string isn't FETCH response*/
int parse_rc;
/* imap_get_literal_count: write number of bytes in an IMAP literal into
* bytes, return 0 on success, -1 on failure. */
-int imap_get_literal_count(const char *buf, long *bytes)
+int imap_get_literal_count(const char *buf, unsigned int *bytes)
{
char *pc;
char *pn;
while (isdigit ((unsigned char) *pc))
pc++;
*pc = 0;
- *bytes = atoi(pn);
+ if (mutt_atoui (pn, bytes) < 0)
+ return -1;
return 0;
}