#include <string.h>
#include <unistd.h>
+#include <errno.h>
#ifdef USE_HCACHE
#define HC_FNAME "mutt" /* filename for hcache as POP lacks paths */
int i, index;
CONTEXT *ctx = (CONTEXT *)data;
POP_DATA *pop_data = (POP_DATA *)ctx->data;
+ char *endp;
+
+ errno = 0;
+ index = strtol(line, &endp, 10);
+ if (errno)
+ return -1;
+ while (*endp == ' ')
+ endp++;
+ memmove(line, endp, strlen(endp) + 1);
- sscanf (line, "%d %s", &index, line);
for (i = 0; i < ctx->msgcount; i++)
if (!mutt_strcmp (line, ctx->hdrs[i]->data))
break;
#include <unistd.h>
#include <ctype.h>
#include <netdb.h>
+#include <errno.h>
/* given an POP mailbox name, return host, port, username and password */
int pop_parse_path (const char* path, ACCOUNT* acct)
int i;
unsigned int index;
CONTEXT *ctx = (CONTEXT *)data;
+ char *endp;
+
+ errno = 0;
+ index = strtoul(line, &endp, 10);
+ if (errno)
+ return -1;
+ while (*endp == ' ')
+ endp++;
+ memmove(line, endp, strlen(endp) + 1);
- sscanf (line, "%u %s", &index, line);
for (i = 0; i < ctx->msgcount; i++)
{
if (!mutt_strcmp (ctx->hdrs[i]->data, line))