int Num_matched = 0; /* Number of matches for completion */
char Completed[STRING] = { 0 }; /* completed string (command or variable) */
-const char *Matches[MAX (NUMVARS, NUMCOMMANDS) + 1]; /* all the matches + User_typed */
+char *Matches[MAX (NUMVARS, NUMCOMMANDS) + 1]; /* all the matches + User_typed */
/* helper function for completion. Changes the dest buffer if
necessary/possible to aid completion.
if (numtabs == 1) {
Num_matched = 0;
m_strcpy(User_typed, sizeof(User_typed), pt);
- p_clear(Matches, sizeof(Matches));
- p_clear(Completed, sizeof(Completed));
+ p_clear(Matches, countof(Matches));
+ p_clear(Completed, countof(Completed));
for (num = 0; Commands[num].name; num++)
candidate (Completed, User_typed, Commands[num].name,
sizeof(Completed));
if (numtabs == 1) {
Num_matched = 0;
m_strcpy(User_typed, sizeof(User_typed), pt);
- p_clear(Matches, sizeof(Matches));
- p_clear(Completed, sizeof(Completed));
+ p_clear(Matches, countof(Matches));
+ p_clear(Completed, countof(Completed));
for (num = 0; MuttVars[num].option; num++)
candidate(Completed, User_typed, MuttVars[num].option,
sizeof(Completed));
if (numtabs == 1) {
Num_matched = 0;
m_strcpy(User_typed, sizeof(User_typed), pt);
- p_clear(Matches, sizeof(Matches));
- p_clear(Completed, sizeof(Completed));
+ p_clear(Matches, countof(Matches));
+ p_clear(Completed, countof(Completed));
for (num = 0; menu[num].name; num++)
candidate (Completed, User_typed, menu[num].name, sizeof(Completed));
/* try the generic menu */