This uses safer quoting and removes an unneeded use of printf.
Fixes the following shellcheck warning.
In qb/qb.libs.sh line 143:
if [ $3 ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.
v2: Remove redundant conditional.
menu/menu_displaylist.c: In function ‘menu_displaylist_ctl’:
menu/menu_displaylist.c:3441:28: warning: ‘ [’ directive output may be truncated writing 2 bytes into a region of size between 1 and 255 [-Wformat-truncation=]
"%s [%s %u]", descriptor, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USER), p + 1);
^~
menu/menu_displaylist.c:3441:25: note: using the range [0, 4294967295] for directive argument
"%s [%s %u]", descriptor, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USER), p + 1);
^~~~~~~~~~~~
menu/menu_displaylist.c:3440:16: note: ‘snprintf’ output 6 or more bytes (assuming 260) into a destination of size 255
snprintf(desc_label, sizeof(desc_label),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"%s [%s %u]", descriptor, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USER), p + 1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C89 builds are only used for the qb build system currently and these are
already checked in qb/config.params.sh.
Additionally the HAVE_NETWORKING check is handled with qb/config.lib.sh
where HAVE_SSL and HAVE_BUILTINMBEDTLS are disabled if networking is
also disabled. The other build systems should never define HAVE_SSL or
HAVE_BUILTINMBEDTLS without HAVE_NETWORKING. Also there are no other
build systems that rely on Makefile.common using this yet.
network/netplay/netplay_frontend.c: In function ‘netplay_announce_cb’:
network/netplay/netplay_frontend.c:734:32: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘int *’ [-Wformat=]
sscanf(val, "%08X", &host_room->gamecrc);
~~~^ ~~~~~~~~~~~~~~~~~~~
%08X
The "z" modifier was introduced in c99, but using "l" instead
seems to work.
setting_list.c: In function ‘setting_get_string_representation_size’:
setting_list.c:175:24: warning: ISO C90 does not support the ‘z’ gnu_printf length modifier [-Wformat=]
snprintf(s, len, "%" PRI_SIZET,
^~~
setting_list.c: In function ‘setting_get_string_representation_size_in_mb’:
setting_list.c:183:24: warning: ISO C90 does not support the ‘z’ gnu_printf length modifier [-Wformat=]
snprintf(s, len, "%" PRI_SIZET,
^~~
setting_list.c: In function ‘setting_set_with_string_representation’:
setting_list.c:508:24: warning: ISO C90 does not support the ‘z’ gnu_scanf length modifier [-Wformat=]
sscanf(value, "%" PRI_SIZET, setting->value.target.sizet);
^~~
libretro-common/file/config_file.c: In function ‘config_get_size_t’:
libretro-common/file/config_file.c:692:32: warning: ISO C90 does not support the ‘z’ gnu_scanf length modifier [-Wformat=]
if (sscanf(entry->value, "%" PRI_SIZET, &val) == 1
dynamic.c:188:26: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
unsigned size = i;
^
dynamic.c:187:20: note: initialize the variable 'i' to silence this warning
unsigned i, j;
^
= 0
1 warning generated.