less horrible strncpy's
[apps/madmutt.git] / init.c
diff --git a/init.c b/init.c
index a456c16..6ca24b3 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2282,7 +2282,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs)
                 Matches[(numtabs - 2) % Num_matched]);
 
     /* return the completed command */
-    strncpy (buffer, Completed, len - spaces);
+    m_strcpy(buffer, len - spaces, Completed);
   }
   else if (!str_ncmp (buffer, "set", 3)
            || !str_ncmp (buffer, "unset", 5)
@@ -2330,7 +2330,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs)
       snprintf (Completed, sizeof(Completed), "%s",
                 Matches[(numtabs - 2) % Num_matched]);
 
-    strncpy (pt, Completed, buffer + len - pt - spaces);
+    m_strcpy(pt, buffer + len - pt - spaces, Completed);
   }
   else if (!str_ncmp (buffer, "exec", 4)) {
     struct binding_t *menu = km_get_table (CurrentMenu);
@@ -2374,7 +2374,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs)
       snprintf (Completed, sizeof(Completed), "%s",
                 Matches[(numtabs - 2) % Num_matched]);
 
-    strncpy (pt, Completed, buffer + len - pt - spaces);
+    m_strcpy(pt, buffer + len - pt - spaces, Completed);
   }
   else
     return 0;