Certain folder settings, combined with sidebar_folder_indent, caused an overflow
when trying to compare paths.
set folder="~/mail/folder"
mailboxes "~/mail/folder/"
Note the trailing / on the mailbox name.
Signed-off-by: Richard Russon <rich@flatcap.org>
const char *tmp_folder_name;
int lastsep = 0;
tmp_folder_name = b->path + maildirlen + 1;
- for (i = 0; i < strlen (tmp_folder_name) - 1; i++) {
- if (SidebarDelimChars &&
- strchr (SidebarDelimChars, tmp_folder_name[i])) {
+ int tmplen = (int) strlen (tmp_folder_name) - 1;
+ for (i = 0; i < tmplen; i++) {
+ if (SidebarDelimChars && strchr (SidebarDelimChars, tmp_folder_name[i])) {
sidebar_folder_depth++;
lastsep = i + 1;
}