summaryrefslogtreecommitdiff
path: root/ncurses/base/lib_chgat.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/base/lib_chgat.c')
-rw-r--r--ncurses/base/lib_chgat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ncurses/base/lib_chgat.c b/ncurses/base/lib_chgat.c
index 74c4f75b44d9..e78c76a69098 100644
--- a/ncurses/base/lib_chgat.c
+++ b/ncurses/base/lib_chgat.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2015,2025 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_chgat.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_chgat.c,v 1.15 2025/02/15 20:53:36 tom Exp $")
NCURSES_EXPORT(int)
wchgat(WINDOW *win,
@@ -62,7 +62,8 @@ wchgat(WINDOW *win,
color_pair));
set_extended_pair(opts, color_pair);
- if (win) {
+ if (win != NULL
+ && color_pair >= 0) {
struct ldat *line = &(win->_line[win->_cury]);
int i;