termio: make code more readable. Closes CID1291865

This commit is contained in:
Boris Faure 2015-03-29 18:45:00 +02:00
parent d2ed329902
commit 29cf913951
1 changed files with 1 additions and 1 deletions

View File

@ -1947,7 +1947,7 @@ _sb_add(struct termio_sb *sb, const char *s, size_t len)
{
size_t new_len = sb->len + len;
if (new_len >= sb->alloc)
if ((new_len >= sb->alloc) || !sb->buf)
{
size_t new_alloc = ((new_len + 15) / 16) * 24;
char *new_buf;