exit strfcpy, only use m_strcpy.
[apps/madmutt.git] / mh.c
diff --git a/mh.c b/mh.c
index da270a2..09a2fb3 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -550,7 +550,7 @@ static void maildir_update_mtime (CONTEXT * ctx)
     if (stat (buf, &st) == 0)
       ctx->mtime_cur = st.st_mtime;
 
-    strfcpy (buf, ctx->path, sizeof (buf));
+    m_strcpy(buf, sizeof(buf), ctx->path);
   }
 
   if (stat (buf, &st) == 0)
@@ -690,7 +690,7 @@ static int maildir_parse_dir (CONTEXT * ctx, struct maildir ***last,
     is_old = (m_strcmp("cur", subdir) == 0);
   }
   else
-    strfcpy (buf, ctx->path, sizeof (buf));
+    m_strcpy(buf, sizeof(buf), ctx->path);
 
   if ((dirp = opendir (buf)) == NULL)
     return -1;
@@ -1044,9 +1044,9 @@ static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr
     *suffix = '\0';
 
   if (hdr && (hdr->read || hdr->old))
-    strfcpy (subdir, "cur", sizeof (subdir));
+    m_strcpy(subdir, sizeof(subdir), "cur");
   else
-    strfcpy (subdir, "new", sizeof (subdir));
+    m_strcpy(subdir, sizeof(subdir), "new");
 
   for (;;) {
     snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
@@ -1115,11 +1115,11 @@ static int maildir_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr)
 
   /* extract the subdir */
   s = strrchr (msg->path, '/') + 1;
-  strfcpy (subdir, s, 4);
+  m_strcpy(subdir, sizeof(subdir), s);
 
   /* extract the flags */
   if ((s = strchr (s, ':')))
-    strfcpy (suffix, s, sizeof (suffix));
+    m_strcpy(suffix, sizeof(suffix), s);
   else
     suffix[0] = '\0';
 
@@ -1266,8 +1266,8 @@ static int mh_rewrite_message (CONTEXT * ctx, int msgno)
   if ((rc = mutt_copy_message (dest->fp, ctx, h,
                                M_CM_UPDATE, CH_UPDATE | CH_UPDATE_LEN)) == 0)
   {
-    snprintf (oldpath, _POSIX_PATH_MAX, "%s/%s", ctx->path, h->path);
-    strfcpy (partpath, h->path, _POSIX_PATH_MAX);
+    snprintf (oldpath, sizeof(oldpath), "%s/%s", ctx->path, h->path);
+    m_strcpy(partpath, sizeof(partpath), h->path);
 
     if (ctx->magic == M_MAILDIR)
       rc = maildir_commit_message (dest, ctx, h);
@@ -1352,7 +1352,7 @@ static int maildir_sync_message (CONTEXT * ctx, int msgno)
       return (-1);
     }
     p++;
-    strfcpy (newpath, p, sizeof (newpath));
+    m_strcpy(newpath, sizeof(newpath), p);
 
     /* kill the previous flags */
     if ((p = strchr (newpath, ':')) != NULL)
@@ -1482,7 +1482,7 @@ static char *maildir_canon_filename (char *dest, const char *src, size_t l)
   if ((t = strrchr (src, '/')))
     src = t + 1;
 
-  strfcpy (dest, src, l);
+  m_strcpy(dest, l, src);
   if ((u = strrchr (dest, ':')))
     *u = '\0';
 
@@ -1708,7 +1708,7 @@ static int mh_check_mailbox (CONTEXT * ctx, int *index_hint, int unused)
   if (!option (OPTCHECKNEW))
     return 0;
 
-  strfcpy (buf, ctx->path, sizeof (buf));
+  m_strcpy(buf, sizeof(buf), ctx->path);
   if (stat (buf, &st) == -1)
     return -1;