fix sidebar counters.
[apps/madmutt.git] / init.c
diff --git a/init.c b/init.c
index 88d3423..6ca24b3 100644 (file)
--- a/init.c
+++ b/init.c
@@ -16,6 +16,7 @@
 
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
+#include <lib-lib/file.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/buffer.h>
@@ -1619,7 +1620,7 @@ static struct option_t* add_user_option (const char* name) {
 
 /* free()'s option_t* */
 static void del_option (void* p) {
-  struct option_tptr = (struct option_t*) p;
+  struct option_t *ptr = (struct option_t*) p;
   char* s = (char*) ptr->data;
   debug_print (1, ("removing option '%s' from table\n", NONULL (ptr->option)));
   p_delete(&ptr->option);
@@ -2281,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)
@@ -2329,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);
@@ -2373,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;
@@ -2685,9 +2686,9 @@ void mutt_init (int skip_sys_rc, LIST * commands)
     Spoolfile = m_strdup(p);
   else {
 #ifdef HOMESPOOL
-    mutt_concat_path (buffer, NONULL (Homedir), MAILPATH, sizeof(buffer));
+    mutt_concat_path(buffer, sizeof(buffer), NONULL(Homedir), MAILPATH);
 #else
-    mutt_concat_path (buffer, MAILPATH, NONULL (Username), sizeof(buffer));
+    mutt_concat_path(buffer, sizeof(buffer), MAILPATH, NONULL(Username));
 #endif
     Spoolfile = m_strdup(buffer);
   }