Merge pull request #4176 from phire/fix_wii_input_display_string

Movie: Fix null pointer dereference.
This commit is contained in:
shuffle2 2016-10-02 20:59:30 -07:00 committed by GitHub
commit 25f983cb21
1 changed files with 8 additions and 8 deletions

View File

@ -784,15 +784,15 @@ static void SetWiiInputDisplayString(int remoteID, u8* const data,
display_str += " 2"; display_str += " 2";
if (buttons.home) if (buttons.home)
display_str += " HOME"; display_str += " HOME";
}
if (accelData) // A few bits of accelData are actually inside the coreData struct.
{ if (accelData)
wm_accel* dt = (wm_accel*)accelData; {
display_str += wm_accel* dt = (wm_accel*)accelData;
StringFromFormat(" ACC:%d,%d,%d", dt->x << 2 | ((wm_buttons*)coreData)->acc_x_lsb, display_str += StringFromFormat(" ACC:%d,%d,%d", dt->x << 2 | buttons.acc_x_lsb,
dt->y << 2 | ((wm_buttons*)coreData)->acc_y_lsb << 1, dt->y << 2 | buttons.acc_y_lsb << 1,
dt->z << 2 | ((wm_buttons*)coreData)->acc_z_lsb << 1); dt->z << 2 | buttons.acc_z_lsb << 1);
}
} }
if (irData) if (irData)