if (state->entrylen + 2 == state->entrymax)
if (state->entrylen + 1 == state->entrymax)
static void imap_add_folder (char delim, char *folder, int noselect,  int noinferiors, struct browser_state *state, short isparent){  char tmp[LONG_STRING];  char relpath[LONG_STRING];  int flen = strlen (folder);  IMAP_MBOX mx;  if (imap_parse_path (state->folder, &mx))    return;  imap_unquote_string (folder);  /* plus 2: folder may be selectable AND have inferiors */  if (state->entrylen + 2 == state->entrymax)  {    safe_realloc ((void **) &state->entry,      sizeof (struct folder_file) * (state->entrymax += 256));    /* apparently linux+glibc2.1 was zeroing this for me? Jon Hellan reports     * that the browser segfaults on more than 256 entries. I never had this     * problem */    memset (state->entry + state->entrylen, 0,      (sizeof (struct folder_file) * (state->entrymax - state->entrylen)));  }  /* render superiors as unix-standard ".." */  if (isparent)    strfcpy (relpath, "../", sizeof (relpath));  /* strip current folder from target, to render a relative path */  else if (!strncmp (mx.mbox, folder, strlen (mx.mbox)))    strfcpy (relpath, folder + strlen (mx.mbox), sizeof (relpath));  else    strfcpy (relpath, folder, sizeof (relpath));  /* apply filemask filter. This should really be done at menu setup rather   * than at scan, since it's so expensive to scan. But that's big changes   * to browser.c */  if (!((regexec (Mask.rx, relpath, 0, NULL, 0) == 0) ^ Mask.not))    return;  if (!noselect)  {    imap_qualify_path (tmp, sizeof (tmp), &mx, folder, NULL);    (state->entry)[state->entrylen].name = safe_strdup (tmp);    (state->entry)[state->entrylen].desc = safe_strdup (relpath);    (state->entry)[state->entrylen].notfolder = 0;    (state->entrylen)++;  }  if (!noinferiors)  {    char trailing_delim[2];    /* create trailing delimiter if necessary */    trailing_delim[1] = '\0';    trailing_delim[0] = (flen && folder[flen - 1] != delim) ? delim : '\0';    imap_qualify_path (tmp, sizeof (tmp), &mx, folder, trailing_delim);    (state->entry)[state->entrylen].name = safe_strdup (tmp);    if (!isparent && (strlen (relpath) < sizeof (relpath) - 2))      strcat (relpath, trailing_delim);    (state->entry)[state->entrylen].desc = safe_strdup (relpath);    (state->entry)[state->entrylen].notfolder = 1;    (state->entrylen)++;  }}