/* Remove headers by copying out data to another file, then
* copying the file back */
- fseeko (fp, b->offset, 0);
+ fseeko (fp, b->offset, SEEK_SET);
mutt_mktemp (tempfile, sizeof (tempfile));
if ((tfp = safe_fopen (tempfile, "w")) == NULL)
{
hn->msgno = hdr->msgno; /* required for MH/maildir */
hn->read = 1;
- fseeko (fp, m->offset, 0);
+ fseeko (fp, m->offset, SEEK_SET);
if (fgets (buf, sizeof (buf), fp) == NULL)
return -1;
if (mx_open_mailbox(path, MUTT_APPEND | MUTT_QUIET, &ctx) == NULL)
mutt_sleep (2);
return -1;
}
- fseeko ((s.fpin = fp), m->offset, 0);
+ fseeko ((s.fpin = fp), m->offset, SEEK_SET);
mutt_decode_attachment (m, &s);
if (safe_fsync_close (&s.fpout) != 0)
/* here we are at the beginning of the file */
if (mutt_strncmp ("From ", buffer, 5) == 0)
{
- fseek (f, 0, 0);
+ fseek (f, 0, SEEK_SET);
return 0;
}
int error;
if (ftello (in) != off_start)
- fseeko (in, off_start, 0);
+ fseeko (in, off_start, SEEK_SET);
buf[0] = '\n';
buf[1] = 0;
mutt_write_mime_header (cur, fpout);
fputc ('\n', fpout);
- fseeko (fp, cur->offset, 0);
+ fseeko (fp, cur->offset, SEEK_SET);
if (mutt_copy_bytes (fp, fpout, cur->length) == -1)
{
safe_fclose (&fp);
}
else
{
- fseeko (fpin, body->offset, 0);
+ fseeko (fpin, body->offset, SEEK_SET);
if (flags & MUTT_CM_PREFIX)
{
int c;
MESSAGE *msg = NULL;
int r;
- fseeko (fpin, hdr->offset, 0);
+ fseeko (fpin, hdr->offset, SEEK_SET);
if (fgets (buf, sizeof (buf), fpin) == NULL)
return -1;
}
unlink (tempfile);
- fseeko (s.fpin, b->offset, 0);
+ fseeko (s.fpin, b->offset, SEEK_SET);
s.fpout = decoded_fp;
mutt_decode_attachment (b, &s);
saved_b_length = b->length;
memset (&s, 0, sizeof (s));
s.fpin = fpin;
- fseeko (s.fpin, b->offset, 0);
+ fseeko (s.fpin, b->offset, SEEK_SET);
mutt_mktemp (tempfile, sizeof (tempfile));
if (!(tmpfp = safe_fopen (tempfile, "w+")))
{
saved_b_length = bb->length;
memset (&s, 0, sizeof (s));
s.fpin = *fpout;
- fseeko (s.fpin, bb->offset, 0);
+ fseeko (s.fpin, bb->offset, SEEK_SET);
mutt_mktemp (tempfile, sizeof (tempfile));
if (!(tmpfp = safe_fopen (tempfile, "w+")))
{
if (!mutt_get_body_charset (body_charset, sizeof (body_charset), m))
strfcpy (body_charset, "iso-8859-1", sizeof (body_charset));
- fseeko (s->fpin, m->offset, 0);
+ fseeko (s->fpin, m->offset, SEEK_SET);
last_pos = m->offset;
for (bytes = m->length; bytes > 0;)
return -1;
}
- fseeko (s->fpin, a->hdr_offset, 0);
+ fseeko (s->fpin, a->hdr_offset, SEEK_SET);
bytes = a->length + a->offset - a->hdr_offset;
hadcr = 0;
while (bytes > 0)
tmplen = sizeof (tmp) - tmplen;
}
- fseeko (f, offset, 0);
+ fseeko (f, offset, SEEK_SET);
while (bytes > 0)
{
if (fgets (p, tmplen - 1, f) == NULL) break;
{
if (s->flags & MUTT_DISPLAY && !option (OPTWEED))
{
- fseeko (s->fpin, choice->hdr_offset, 0);
+ fseeko (s->fpin, choice->hdr_offset, SEEK_SET);
mutt_copy_bytes(s->fpin, s->fpout, choice->offset-choice->hdr_offset);
}
print_part_line (s, p, 0);
if (!option (OPTWEED))
{
- fseeko (s->fpin, p->hdr_offset, 0);
+ fseeko (s->fpin, p->hdr_offset, SEEK_SET);
mutt_copy_bytes(s->fpin, s->fpout, p->offset-p->hdr_offset);
}
else
else if (istext && b->charset)
cd = mutt_iconv_open (Charset, b->charset, MUTT_ICONV_HOOK_FROM);
- fseeko (s->fpin, b->offset, 0);
+ fseeko (s->fpin, b->offset, SEEK_SET);
switch (b->encoding)
{
case ENCQUOTEDPRINTABLE:
int decode = 0;
int rc = 0;
- fseeko (s->fpin, b->offset, 0);
+ fseeko (s->fpin, b->offset, SEEK_SET);
#ifdef USE_FMEMOPEN
char *temp = NULL;
return -1;
}
- fseek (ctx->fp, 0, 2);
+ fseek (ctx->fp, 0, SEEK_END);
return 0;
}
if (*buf_ready == 0)
{
if (offset != *last_pos)
- fseeko (f, offset, 0);
+ fseeko (f, offset, SEEK_SET);
if ((*buf = (unsigned char *) mutt_read_line ((char *) *buf, blen, f, &l, MUTT_EOL)) == NULL)
{
fmt[0] = 0;
continue;
}
- fseeko (f, loc, 0);
+ fseeko (f, loc, SEEK_SET);
break; /* end of header */
}
return 0;
}
- fseeko (msg->fp, h->offset, 0);
+ fseeko (msg->fp, h->offset, SEEK_SET);
mutt_body_handler (h->content, &s);
}
#else
fp = s.fpout;
fflush (fp);
- fseek (fp, 0, 0);
+ fseek (fp, 0, SEEK_SET);
fstat (fileno (fp), &st);
lng = (long) st.st_size;
#endif
fp = msg->fp;
if (pat->op != MUTT_BODY)
{
- fseeko (fp, h->offset, 0);
+ fseeko (fp, h->offset, SEEK_SET);
lng = h->content->offset - h->offset;
}
if (pat->op != MUTT_HEADER)
{
if (pat->op == MUTT_BODY)
- fseeko (fp, h->content->offset, 0);
+ fseeko (fp, h->content->offset, SEEK_SET);
lng += h->content->length;
}
}
rc = 0; /* silence false compiler warning if (s->flags & MUTT_DISPLAY) */
- fseeko (s->fpin, m->offset, 0);
+ fseeko (s->fpin, m->offset, SEEK_SET);
last_pos = m->offset;
for (bytes = m->length; bytes > 0;)
return -1;
}
- fseeko (s->fpin, sigbdy->offset, 0);
+ fseeko (s->fpin, sigbdy->offset, SEEK_SET);
mutt_copy_bytes (s->fpin, fp, sigbdy->length);
safe_fclose (&fp);
* the temporary file.
*/
- fseeko (s->fpin, a->offset, 0);
+ fseeko (s->fpin, a->offset, SEEK_SET);
mutt_copy_bytes (s->fpin, pgptmp, a->length);
safe_fclose (&pgptmp);
}
unlink (tempfile);
- fseeko (s.fpin, b->offset, 0);
+ fseeko (s.fpin, b->offset, SEEK_SET);
s.fpout = decoded_fp;
mutt_decode_attachment (b, &s);
/* parse the message header and MIME structure */
- fseeko (fp, hdr->offset, 0);
+ fseeko (fp, hdr->offset, SEEK_SET);
newhdr->offset = hdr->offset;
/* enable header weeding for resent messages */
newhdr->env = mutt_read_rfc822_header (fp, newhdr, 1, resend);
goto cleanup;
}
- fseeko (fpin, a->offset, 0);
+ fseeko (fpin, a->offset, SEEK_SET);
a->parts = mutt_parse_message_rfc822 (fpin, a);
transform_to_7bit (a->parts, fpin);
if (!option (OPTBOUNCEDELIVERED))
ch_flags |= CH_WEED_DELIVERED;
- fseeko (fp, h->offset, 0);
+ fseeko (fp, h->offset, SEEK_SET);
fprintf (f, "Resent-From: %s", resent_from);
fprintf (f, "\nResent-%s", mutt_make_date (date, sizeof(date)));
msgid_str = gen_msgid();
* this will happen, and it can cause problems parsing the mailbox
* later.
*/
- fseek (tempfp, -1, 2);
+ fseek (tempfp, -1, SEEK_END);
if (fgetc (tempfp) != '\n')
{
- fseek (tempfp, 0, 2);
+ fseek (tempfp, 0, SEEK_END);
fputc ('\n', tempfp);
}
return NULL;
}
- fseeko (s->fpin, m->offset, 0);
+ fseeko (s->fpin, m->offset, SEEK_SET);
mutt_copy_bytes (s->fpin, tmpfp, m->length);
memset (&s, 0, sizeof (s));
s.fpin = fpin;
- fseeko (s.fpin, b->offset, 0);
+ fseeko (s.fpin, b->offset, SEEK_SET);
mutt_mktemp (tempfile, sizeof (tempfile));
if ((tmpfp = safe_fopen (tempfile, "w+")) == NULL)