static struct history History[HC_LAST];
static int OldSize = 0;
-#define GET_HISTORY(CLASS) ((CLASS < 0 || CLASS >= HC_LAST) ? NULL : &History[CLASS])
+#define GET_HISTORY(CLASS) ((CLASS >= HC_LAST) ? NULL : &History[CLASS])
static void init_history (struct history *h)
{
if ((f = fopen (HistFile, "r")) == NULL)
return;
- while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL)
+ while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, 0)) != NULL)
{
read = 0;
if (sscanf (linebuf, "%d:%n", &hclass, &read) < 1 || read == 0 ||
}
}
- fclose (f);
+ safe_fclose (&f);
FREE (&linebuf);
}
return;
line = 0;
- while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL)
+ while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, 0)) != NULL)
{
if (sscanf (linebuf, "%d", &hclass) < 1 || hclass < 0)
{
{
rewind (f);
line = 0;
- while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL)
+ while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, 0)) != NULL)
{
if (sscanf (linebuf, "%d", &hclass) < 1 || hclass < 0)
{
}
cleanup:
- fclose (f);
+ safe_fclose (&f);
FREE (&linebuf);
if (tmp != NULL)
{
{
rewind (tmp);
mutt_copy_stream (tmp, f);
- fclose (f);
+ safe_fclose (&f);
}
- fclose (tmp);
+ safe_fclose (&tmp);
unlink (tmpfname);
}
}
}
fputs ("|\n", f);
- fclose (f);
+ safe_fclose (&f);
FREE (&tmp);
if (--n < 0)