X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=browser.c;h=763a5be6c3d46f5051ece47982499c5aba6a8b2f;hp=3fd356346d17f7a523719d06f13ac91673fd7794;hb=c98480f8568e6c1bc927c6c5f2b5e80b4aa6548c;hpb=ae0ce4dfcafa0c3820f107c5bfa8bd06e5272b57 diff --git a/browser.c b/browser.c index 3fd3563..763a5be 100644 --- a/browser.c +++ b/browser.c @@ -96,7 +96,7 @@ static int browser_compare_subject (const void *a, const void *b) struct folder_file *pa = (struct folder_file *) a; struct folder_file *pb = (struct folder_file *) b; - int r = str_coll (pa->name, pb->name); + int r = strcoll(NONULL(pa->name), NONULL(pb->name)); return ((BrowserSort & SORT_REVERSE) ? -r : r); } @@ -350,7 +350,7 @@ static const char *newsgroup_format_str (char *dest, size_t destlen, char op, break; case 'f': - strncpy (fn, folder->ff->name, sizeof (fn) - 1); + m_strcpy(fn, sizeof(fn), folder->ff->name); snprintf (tmp, sizeof (tmp), "%%%ss", fmt); snprintf (dest, destlen, tmp, fn); break; @@ -535,7 +535,7 @@ static int examine_directory (MUTTMENU * menu, struct browser_state *state, continue; /* we don't need . */ if (prefix && *prefix - && str_ncmp (prefix, de->d_name, m_strlen(prefix)) != 0) + && m_strncmp(prefix, de->d_name, m_strlen(prefix)) != 0) continue; if (!((regexec (Mask.rx, de->d_name, 0, NULL, 0) == 0) ^ Mask.not)) continue; @@ -779,15 +779,13 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, for (i = m_strlen(f) - 1; i > 0 && f[i] != '/'; i--); if (i > 0) { if (f[0] == '/') { - if (i > sizeof (LastDir) - 1) - i = sizeof (LastDir) - 1; - strncpy (LastDir, f, i); - LastDir[i] = 0; + i = MIN(sizeof(LastDir) - 1, i); + m_strcpy(LastDir, sizeof(LastDir), f); } else { - getcwd (LastDir, sizeof (LastDir)); - str_cat (LastDir, sizeof (LastDir), "/"); - str_ncat (LastDir, sizeof (LastDir), f, i); + getcwd(LastDir, sizeof(LastDir)); + m_strcat(LastDir, sizeof(LastDir), "/"); + m_strncat(LastDir, sizeof(LastDir), f, i); } } else {