[935] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r922 - trunk/owl

daemon@ATHENA.MIT.EDU (asedeno@MIT.EDU)
Thu Oct 29 18:11:18 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
X-Original-To: nelhage@nelhage.com
To: dirty-owl-hackers@mit.edu
From: asedeno@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Sun,  3 Feb 2008 00:49:47 -0500 (EST)

Author: asedeno
Date: 2008-02-03 00:49:46 -0500 (Sun, 03 Feb 2008)
New Revision: 922

Modified:
   trunk/owl/fmtext.c
Log:
Bounds checking.

Modified: trunk/owl/fmtext.c
===================================================================
--- trunk/owl/fmtext.c	2008-02-01 18:55:37 UTC (rev 921)
+++ trunk/owl/fmtext.c	2008-02-03 05:49:46 UTC (rev 922)
@@ -739,6 +739,10 @@
   owl_colorpair_mgr *cpmgr;
   short pair, default_bg;
 
+  /* Sanity (Bounds) Check */
+  if (fg > COLORS || fg < OWL_COLOR_DEFAULT) fg = OWL_COLOR_DEFAULT;
+  if (bg > COLORS || bg < OWL_COLOR_DEFAULT) bg = OWL_COLOR_DEFAULT;
+	    
 #ifdef HAVE_USE_DEFAULT_COLORS
   if (fg == OWL_COLOR_DEFAULT) fg = -1;
   default_bg = OWL_COLOR_DEFAULT;


home help back first fref pref prev next nref lref last post