mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
get_bind_string_joyaxis - small simplification
This commit is contained in:
parent
d6ae25d980
commit
e5ef309b58
1 changed files with 5 additions and 4 deletions
|
@ -3180,12 +3180,13 @@ void input_config_get_bind_string_joyaxis(
|
||||||
bind->joyaxis_label, suffix, ' ', size);
|
bind->joyaxis_label, suffix, ' ', size);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
size_t _len = strlcpy(buf, "Axis ", size);
|
||||||
if (AXIS_NEG_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
if (AXIS_NEG_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
||||||
snprintf(buf, size, "%s-%u",
|
snprintf(buf + _len, size - _len, "-%u",
|
||||||
"Axis ", (unsigned)AXIS_NEG_GET(bind->joyaxis));
|
(unsigned)AXIS_NEG_GET(bind->joyaxis));
|
||||||
else if (AXIS_POS_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
else if (AXIS_POS_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
||||||
snprintf(buf, size, "%s+%u",
|
snprintf(buf + _len, size - _len, "+%u",
|
||||||
"Axis ", (unsigned)AXIS_POS_GET(bind->joyaxis));
|
(unsigned)AXIS_POS_GET(bind->joyaxis));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue