Kernel - Fixing bugs exposed with `qemu -nographic`
[tpg/acess2.git] / KernelLand / Modules / Input / Keyboard / main.c
index 49e7777..9c2e20e 100644 (file)
@@ -29,7 +29,7 @@ extern void   Heap_Stats(void);
 
 // === PROTOTYPES ===
  int   Keyboard_Install(char **Arguments);
-void   Keyboard_Cleanup(void);
+ int   Keyboard_Cleanup(void);
 // - Internal
 tKeymap        *Keyboard_LoadMap(const char *Name);
 void   Keyboard_FreeMap(tKeymap *Keymap);
@@ -68,9 +68,10 @@ int Keyboard_Install(char **Arguments)
 /**
  * \brief Pre-unload cleanup function
  */
-void Keyboard_Cleanup(void)
+int Keyboard_Cleanup(void)
 {
        // TODO: Do I need this?
+       return 0;
 }
 
 // --- Map Management ---
@@ -163,6 +164,15 @@ void Keyboard_HandleKey(tKeyboard *Source, Uint32 HIDKeySym)
        Uint32  flag;
        Uint8   layer;
        
+       if( !Source ) {
+               Log_Error("Keyboard", "Passed NULL handle");
+               return ;
+       }
+       if( !Source->Node ) {
+               Log_Error("Keyboard", "Passed handle with NULL node");
+               return ;
+       }
+       
        bPressed = !(HIDKeySym & (1 << 31));
        HIDKeySym &= 0x7FFFFFFF;
 

UCC git Repository :: git.ucc.asn.au