]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't use uninitialized variable in wxCharCodeWXToOSX().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 22 Aug 2010 22:58:25 +0000 (22:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 22 Aug 2010 22:58:25 +0000 (22:58 +0000)
If an unsupported wxKeyCode was passed to this function, an undefined value
was returned. Return -1 instead to indicate failure.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/uiaction_osx.cpp

index a1667c6bfb31965f29012ae5e2707596847e3303..c2ebb321b301b11e20cd2bc49884a3df3f771889 100644 (file)
@@ -180,7 +180,9 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code)
         case WXK_NUMPAD_DECIMAL:   keycode = kVK_ANSI_KeypadDecimal; break;
         case WXK_NUMPAD_DIVIDE:    keycode = kVK_ANSI_KeypadDivide; break;
 
-        default: wxLogDebug( "Unrecognised keycode %d", code );
+        default:
+            wxLogDebug( "Unrecognised keycode %d", code );
+            keycode = -1;
     }
 
     return keycode;