aboutsummaryrefslogtreecommitdiff
path: root/ncurses/base/new_pair.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2024-06-20 08:11:38 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2024-06-20 08:11:38 +0000
commit24fa7a5107c5b75d1c197accf0305be64bc72882 (patch)
tree183f09c93417ac0e5f7f49760329a3d2cfaacda9 /ncurses/base/new_pair.c
parentbf0ab54638a5ef969749f6ceae30e864f9556ea8 (diff)
Diffstat (limited to 'ncurses/base/new_pair.c')
-rw-r--r--ncurses/base/new_pair.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ncurses/base/new_pair.c b/ncurses/base/new_pair.c
index c04f4acbb95d..70866c636812 100644
--- a/ncurses/base/new_pair.c
+++ b/ncurses/base/new_pair.c
@@ -61,7 +61,7 @@
#endif
-MODULE_ID("$Id: new_pair.c,v 1.21 2021/02/14 00:17:09 tom Exp $")
+MODULE_ID("$Id: new_pair.c,v 1.23 2021/08/16 22:11:26 tom Exp $")
#if NCURSES_EXT_COLORS
@@ -106,7 +106,7 @@ dumpit(SCREEN *sp, int pair, const char *tag)
size_t have = sizeof(bigbuf);
_nc_STRCPY(p, tag, have);
- for (n = 0; n < sp->_pair_limit; ++n) {
+ for (n = 0; n < sp->_pair_alloc; ++n) {
if (list[n].mode != cpFREE) {
p += strlen(p);
if ((size_t) (p - bigbuf) + 50 > have)
@@ -297,7 +297,7 @@ NCURSES_SP_NAME(alloc_pair) (NCURSES_SP_DCLx int fg, int bg)
found = TRUE;
}
}
- if (!found) {
+ if (!found && SP_PARM->_color_pairs != NULL) {
for (pair = 1; pair <= hint; pair++) {
if (SP_PARM->_color_pairs[pair].mode == cpFREE) {
T(("found gap %d", pair));