Skip to content

Commit

Permalink
Fix possible null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Brawl345 committed Jan 25, 2025
1 parent b0171e2 commit bddb25f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ ON_APPLICATION_START() { initLogging(); }
ON_APPLICATION_ENDS() { deinitLogging(); }

DECL_FUNCTION(int32_t, VPADRead, int32_t chan, VPADStatus *buffer,
uint32_t buffer_size, int32_t *error) {
int32_t result = real_VPADRead(chan, buffer, buffer_size, error);
if (result > 0 && *error == VPAD_READ_SUCCESS) {
uint32_t buffer_size, VPADReadError *error) {
VPADReadError real_error = VPAD_READ_SUCCESS;
int32_t result = real_VPADRead(chan, buffer, buffer_size, &real_error);

if (result > 0 && real_error == VPAD_READ_SUCCESS) {
if (buffer[0].hold == (VPAD_BUTTON_ZL | VPAD_BUTTON_L | VPAD_BUTTON_DOWN)) {
WPADDisconnect(WPAD_CHAN_0);
} else if (buffer[0].hold ==
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

#include "version.h"

#define VERSION "v1.1"
#define VERSION "v1.1.1"
#define VERSION_FULL VERSION VERSION_EXTRA

0 comments on commit bddb25f

Please sign in to comment.