test return of ty_sb_add(). Closes CID1408482

terminology-1.6
Boris Faure 3 years ago
parent b76bbbe455
commit a782ce61e2
Signed by: borisfaure
GPG Key ID: EAA9CD729F522998
  1. 16
      src/bin/termiointernals.c
  2. 18
      src/bin/termpty.c

@ -414,9 +414,21 @@ termio_internal_get_selection(Termio *sd, size_t *lenp)
if (isb.len)
{
int res;
if (isb.buf[isb.len - 1] != '\n' && i != end_y)
ty_sb_add(&isb, "\n", 1);
ty_sb_add(&sb, isb.buf, isb.len);
{
res = ty_sb_add(&isb, "\n", 1);
if (res < 0)
{
ERR("failure to add newline to selection buffer");
}
}
res = ty_sb_add(&sb, isb.buf, isb.len);
if (res < 0)
{
ERR("failure to add %zd characters to selection buffer",
isb.len);
}
}
ty_sb_free(&isb);
}

@ -1305,11 +1305,19 @@ termpty_write(Termpty *ty, const char *input, int len)
#if defined(ENABLE_FUZZING)
return;
#endif
ty_sb_add(&ty->write_buffer, input, len);
ecore_main_fd_handler_active_set(ty->hand_fd,
ECORE_FD_ERROR |
ECORE_FD_READ |
ECORE_FD_WRITE);
int res = ty_sb_add(&ty->write_buffer, input, len);
if (res < 0)
{
ERR("failure to add %d characters to write buffer", len);
}
else
{
ecore_main_fd_handler_active_set(ty->hand_fd,
ECORE_FD_ERROR |
ECORE_FD_READ |
ECORE_FD_WRITE);
}
}
struct screen_info

Loading…
Cancel
Save