From 1cac4d45c4ab74c36898d37c097fe76c1ad43c13 Mon Sep 17 00:00:00 2001 From: jdc Date: Mon, 25 Nov 2002 09:11:18 +0000 Subject: [PATCH] Don't allow default colour setting to be overwritten in init_pair(). (Also noticed by Pooka). --- lib/libcurses/color.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libcurses/color.c b/lib/libcurses/color.c index e7c6f63c2c22..30c505392303 100644 --- a/lib/libcurses/color.c +++ b/lib/libcurses/color.c @@ -1,4 +1,4 @@ -/* $NetBSD: color.c,v 1.20 2002/10/22 11:37:34 blymn Exp $ */ +/* $NetBSD: color.c,v 1.21 2002/11/25 09:11:18 jdc Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #ifndef lint -__RCSID("$NetBSD: color.c,v 1.20 2002/10/22 11:37:34 blymn Exp $"); +__RCSID("$NetBSD: color.c,v 1.21 2002/11/25 09:11:18 jdc Exp $"); #endif /* not lint */ #include "curses.h" @@ -284,7 +284,7 @@ init_pair(short pair, short fore, short back) __CTRACE("init_pair: %d, %d, %d\n", pair, fore, back); #endif - if (pair < 0 || pair > COLOR_PAIRS) + if (pair < 0 || pair >= COLOR_PAIRS) return (ERR); if (fore < -1 || fore >= COLORS) return (ERR);