Skip to content

Commit 1761e78

Browse files
authored
Merge pull request #571 from pifopi/fix-debug
Fix button_to_string when str is empty
2 parents ee29cdc + f476808 commit 1761e78

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerState.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ std::string button_to_string(Button button){
3434
if (button & BUTTON_LEFT_SR) str += "Left-SR";
3535
if (button & BUTTON_RIGHT_SL) str += "Right-SL";
3636
if (button & BUTTON_RIGHT_SR) str += "Right-SR";
37-
if (str.back() == ' '){
38-
str.pop_back();
39-
}
4037
if (str.empty()){
4138
str = "none";
4239
}
40+
if (str.back() == ' '){
41+
str.pop_back();
42+
}
4343
return str;
4444
}
4545
std::string dpad_to_string(DpadPosition dpad){

0 commit comments

Comments
 (0)