Projects STRLCPY neomutt Commits 9bb04465
🤬
  • buffer: never shrink

    When resizing a Buffer, don't let it shrink.
    The worst case is (new_size == 0), which would cause realloc to free the
    pointer.
  • Loading...
  • Richard Russon committed 2 years ago
    9bb04465
    1 parent 7068adc3
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■
    mutt/buffer.c
    skipped 267 lines
    268 268   if (!buf)
    269 269   return;
    270 270   
    271  - if (buf->data && (new_size > 0) && (new_size <= buf->dsize))
     271 + if (buf->data && (new_size <= buf->dsize))
    272 272   return;
    273 273   
    274 274   const bool was_empty = (buf->dptr == NULL);
    skipped 201 lines
Please wait...
Page is in error, reload to recover