logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0005-Return-early-from-_cursesi_waddbytes-if-_cursesi_add.patch (893B)


  1. From c977aac84ce6c6e2737a8a072cb4116b8ee4278e Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Thu, 3 Jun 2021 00:42:45 -0700
  4. Subject: [PATCH] Return early from _cursesi_waddbytes if _cursesi_addwchar
  5. fails
  6. This error may indicate that scrolling was required in a non-scrolling
  7. window, in which case the rest of the string should be truncated.
  8. ---
  9. lib/libcurses/addbytes.c | 2 +-
  10. 1 file changed, 1 insertion(+), 1 deletion(-)
  11. diff --git a/lib/libcurses/addbytes.c b/lib/libcurses/addbytes.c
  12. index e52dc310..5d783df8 100644
  13. --- a/lib/libcurses/addbytes.c
  14. +++ b/lib/libcurses/addbytes.c
  15. @@ -132,7 +132,7 @@ _cursesi_waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr,
  16. #ifdef HAVE_WCHAR
  17. (void)memset(&st, 0, sizeof(st));
  18. #endif
  19. - while (count > 0) {
  20. + while (count > 0 && err == OK) {
  21. #ifndef HAVE_WCHAR
  22. c = *bytes++;
  23. #ifdef DEBUG
  24. --
  25. 2.31.1