qsort (Maildir, num_maildir_entries, sizeof(*Maildir), maildir_srt);
}
- if ((cp = strdup(newmail)) == (char *)0)
+ if ((cp = strdup(newmail)) == NULL)
adios (NULL, "error allocating memory to copy newmail");
newmail = cp;
folder = getfolder (0);
maildir = m_maildir (folder);
- if ((maildir_copy = strdup(maildir)) == (char *)0)
+ if ((maildir_copy = strdup(maildir)) == NULL)
adios (maildir, "error allocating memory to copy maildir");
if (!folder_exists(maildir)) {
msgnum++;
if (packfile) {
+ size_t len;
+
fseek (pf, 0L, SEEK_CUR);
pos = ftell (pf);
size = 0;
- if (fwrite (mmdlm1, 1, strlen (mmdlm1), pf) < strlen (mmdlm1)) {
+ len = strlen(mmdlm1);
+ if (fwrite(mmdlm1, 1, len, pf) < len)
advise (mmdlm1, "fwrite");
- }
start = ftell (pf);
if (pop_retr (i, pop_pack) == NOTOK)
adios (packfile, "write error on");
fseek (pf, start, SEEK_SET);
} else {
- cp = getcpy (m_name (msgnum));
+ cp = mh_xstrdup(m_name (msgnum));
if ((pf = fopen (cp, "w+")) == NULL)
adios (cp, "unable to write");
chmod (cp, m_gmprot ());
charstring_free (scanl);
if (packfile) {
+ size_t len;
+
fseek (pf, stop, SEEK_SET);
- if (fwrite (mmdlm2, 1, strlen (mmdlm2), pf) < strlen (mmdlm1)) {
+ len = strlen(mmdlm2);
+ if (fwrite(mmdlm2, 1, len, pf) < len)
advise (mmdlm2, "fwrite");
- }
if (fflush (pf) || ferror (pf)) {
int e = errno;
pop_quit ();
*/
(void)snprintf(b, sizeof (b), "%s/%d", maildir_copy, msgnum + 1);
- (void)ext_hook("add-hook", b, (char *)0);
+ (void)ext_hook("add-hook", b, NULL);
if (aud)
fputs (charstring_buffer (scanl), aud);
msgnum++;
sp = Maildir[i].filename;
- cp = getcpy (m_name (msgnum));
+ cp = mh_xstrdup(m_name (msgnum));
pf = NULL;
if (!trnflag || link(sp, cp) == -1) {
static char buf[65536];
*/
(void)snprintf(b, sizeof (b), "%s/%d", maildir_copy, msgnum + 1);
- (void)ext_hook("add-hook", b, (char *)0);
+ (void)ext_hook("add-hook", b, NULL);
if (aud)
fputs (charstring_buffer (scanl), aud);