Review variables initialization

- All variables are initialized on declaration, some arrays were not properly initialized
 - Static array buffers require memset() for re-initialization on every function call
This commit is contained in:
Ray 2021-11-09 11:49:03 +01:00
parent 8ec5b2dc2f
commit 21ec8c38ae
4 changed files with 27 additions and 24 deletions

View file

@ -5633,8 +5633,8 @@ static void ProcessKeyboard(void)
#define MAX_KEYBUFFER_SIZE 32 // Max size in bytes to read
// Keyboard input polling (fill keys[256] array with status)
int bufferByteCount = 0; // Bytes available on the buffer
char keysBuffer[MAX_KEYBUFFER_SIZE]; // Max keys to be read at a time
int bufferByteCount = 0; // Bytes available on the buffer
char keysBuffer[MAX_KEYBUFFER_SIZE] = { 0 }; // Max keys to be read at a time
// Read availables keycodes from stdin
bufferByteCount = read(STDIN_FILENO, keysBuffer, MAX_KEYBUFFER_SIZE); // POSIX system call