1
0
Fork 0

Jim Wilson:

This is a patch to viewmgr.cxx that I've had for a long time.  This just prevents a possible segfault caused by misconfiguration.
This commit is contained in:
ehofman 2003-05-09 08:31:56 +00:00
parent 8ef4374edb
commit 228d6b2f29

View file

@ -632,7 +632,12 @@ FGViewMgr::getView () const
void
FGViewMgr::setView (int newview )
{
if ( newview < 0 || newview > (int)views.size() ) {
// if newview number too low wrap to last view...
if ( newview < 0 ) {
newview = (int)views.size() -1;
}
// if newview number to high wrap to zero...
if ( newview > ((int)views.size() -1) ) {
newview = 0;
}
// set new view