From 9ce320c558f933f85424b949ca3d880e77d90e2f Mon Sep 17 00:00:00 2001
From: mfranz <mfranz>
Date: Sat, 17 Nov 2007 17:38:48 +0000
Subject: [PATCH] initialize release_keys array

---
 src/Main/FGManipulator.cxx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/Main/FGManipulator.cxx b/src/Main/FGManipulator.cxx
index bf6935de4..492f17966 100644
--- a/src/Main/FGManipulator.cxx
+++ b/src/Main/FGManipulator.cxx
@@ -43,6 +43,9 @@ FGManipulator::FGManipulator() :
     numlockKeyMap[GUIEventAdapter::KEY_KP_Home] = '7';
     numlockKeyMap[GUIEventAdapter::KEY_KP_Up] = '8';
     numlockKeyMap[GUIEventAdapter::KEY_KP_Page_Up] = '9';
+
+    for (int i = 0; i < 128; i++)
+        release_keys[i] = i;
 }
 
 void FGManipulator::setByMatrix(const osg::Matrixd& matrix)
@@ -278,7 +281,7 @@ void FGManipulator::handleKey(const osgGA::GUIEventAdapter& ea, int& key,
 	modifiers |= KEYMOD_RELEASED;
 
     // Release the letter key, for which the keypress was reported
-    if (key >= 0 && key < int(sizeof(release_keys))) {
+    if (key >= 0 && key < 128) {
         if (modifiers & KEYMOD_RELEASED) {
             key = release_keys[key];
         } else {