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:
parent
8ef4374edb
commit
228d6b2f29
1 changed files with 6 additions and 1 deletions
|
@ -632,7 +632,12 @@ FGViewMgr::getView () const
|
||||||
void
|
void
|
||||||
FGViewMgr::setView (int newview )
|
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;
|
newview = 0;
|
||||||
}
|
}
|
||||||
// set new view
|
// set new view
|
||||||
|
|
Loading…
Add table
Reference in a new issue