*/
static int
get_multipart_boundary (CT ct, char **part_boundary) {
- char buffer[BUFSIZ];
+ char buffer[NMH_BUFSIZ];
char *end_boundary = NULL;
off_t begin = (off_t) ct->c_end > (off_t) (ct->c_begin + sizeof buffer)
? (off_t) (ct->c_end - sizeof buffer)
size_t bytes_read;
int status = OK;
- /* This will fail if the boundary spans fread() calls. BUFSIZ should
+ /* This will fail if the boundary spans fread() calls. NMH_BUFSIZ should
be big enough, even if it's just 1024, to make that unlikely. */
/* free_content() will close ct->c_fp. */
replace_boundary (CT ct, char *file, char *boundary) {
FILE *fpin, *fpout;
int compnum, state;
- char buf[BUFSIZ], name[NAMESZ];
+ char buf[NMH_BUFSIZ], name[NAMESZ];
char *np, *vp;
m_getfld_state_t gstate = 0;
int status = OK;
}
output_encoding = content_encoding (ct, &reason);
- if (set_ct_type (ct, c_type, output_subtype, output_encoding) == OK) {
+ if (status == OK &&
+ set_ct_type (ct, c_type, output_subtype, output_encoding) == OK) {
ct->c_cefile.ce_file = file;
ct->c_cefile.ce_unlink = 1;
} else {
*/
static int
boundary_in_content (FILE **fp, char *file, const char *boundary) {
- char buffer[BUFSIZ];
+ char buffer[NMH_BUFSIZ];
size_t bytes_read;
int found_boundary = 0;
if (ce->ce_file) {
size_t line_len = 0;
- char buffer[BUFSIZ];
+ char buffer[NMH_BUFSIZ];
size_t inbytes;
if (! ce->ce_fp && (ce->ce_fp = fopen (ce->ce_file, "r")) == NULL) {
}
if (fp && *fp) {
- char buffer[BUFSIZ];
+ char buffer[NMH_BUFSIZ];
size_t bytes_read;
size_t bytes_to_read =
end > 0 && end > begin ? end - begin : sizeof buffer;
int i = -1;
if (old != -1 && new != -1) {
- char buffer[BUFSIZ];
+ char buffer[NMH_BUFSIZ];
while ((i = read (old, buffer, sizeof buffer)) >
0) {