static int
hcache_open_gdbm (struct header_cache* h, const char* path)
{
- int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384;
+ int pagesize;
+
+ if (mutt_atoi (HeaderCachePageSize, &pagesize) < 0 || pagesize <= 0)
+ pagesize = 16384;
h->db = gdbm_open((char *) path, pagesize, GDBM_WRCREAT, 00600, NULL);
if (h->db)
struct stat sb;
int ret;
u_int32_t createflags = DB_CREATE;
- int pagesize = atoi (HeaderCachePageSize);
+ int pagesize;
+
+ if (mutt_atoi (HeaderCachePageSize, &pagesize) < 0 || pagesize <= 0)
+ pagesize = 16384;
snprintf (h->lockfile, _POSIX_PATH_MAX, "%s-lock-hack", path);
else
p = ctx->hdrs[l]->path;
- i = atoi (p);
+ if (mutt_atoi (p, &i) < 0)
+ continue;
if (!ctx->hdrs[l]->read)
{
else
p = md->h->path;
- i = atoi (p);
+ if (mutt_atoi (p, &i) < 0)
+ continue;
f = mhs_check (mhs, i);
md->h->read = (f & MH_SEQ_UNSEEN) ? 0 : 1;