if (option (OPTMAILCAPSANITIZE))
mutt_sanitize_filename (type, 0);
- while (command[x] && x<clen && y<sizeof(buf))
+ while (x < clen && command[x] && y < sizeof (buf) - 1)
{
- if (command[x] == '\\') {
+ if (command[x] == '\\')
+ {
x++;
buf[y++] = command[x++];
}
int z = 0;
x++;
- while (command[x] && command[x] != '}' && z<sizeof(param))
+ while (command[x] && command[x] != '}' && z < sizeof (param) - 1)
param[z++] = command[x++];
param[z] = '\0';
if ((fp = fopen (filename, "r")) != NULL)
{
- while (!found && (buf = mutt_read_line (buf, &buflen, fp, &line)) != NULL)
+ while (!found && (buf = mutt_read_line (buf, &buflen, fp, &line, M_CONT)) != NULL)
{
/* ignore comments */
if (*buf == '#')
}
}
} /* while (!found && (buf = mutt_read_line ())) */
- fclose (fp);
+ safe_fclose (&fp);
} /* if ((fp = fopen ())) */
FREE (&buf);
return found;
/* rfc1524 specifies that a path of mailcap files should be searched.
* joy. They say
* $HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap, etc
- * and overriden by the MAILCAPS environment variable, and, just to be nice,
+ * and overridden by the MAILCAPS environment variable, and, just to be nice,
* we'll make it specifiable in .muttrc
*/
if (!curr || !*curr)
return 3;
if ((nfp = safe_fopen (newfile,"w")) == NULL)
{
- fclose(ofp);
+ safe_fclose (&ofp);
return 3;
}
mutt_copy_stream (ofp,nfp);
- fclose (nfp);
- fclose (ofp);
+ safe_fclose (&nfp);
+ safe_fclose (&ofp);
mutt_unlink (oldfile);
return 0;
}