Get rid of variable-length array
This commit is contained in:
parent
f63385de08
commit
794de84961
|
@ -18,15 +18,12 @@ bool badge_exists(const char* filepath)
|
||||||
|
|
||||||
void set_badge_menu_texture(badges_ctx_t * badges, int i)
|
void set_badge_menu_texture(badges_ctx_t * badges, int i)
|
||||||
{
|
{
|
||||||
|
char badge_file[16];
|
||||||
char fullpath[PATH_MAX_LENGTH];
|
char fullpath[PATH_MAX_LENGTH];
|
||||||
const char * locked_suffix = (badges->badge_locked[i] == true)
|
const char * locked_suffix = (badges->badge_locked[i] == true)
|
||||||
? "_lock.png" : ".png";
|
? "_lock.png" : ".png";
|
||||||
unsigned int bufferSize = 16;
|
|
||||||
|
|
||||||
/* TODO/FIXME - variable length forbidden in C89 - rewrite this! */
|
snprintf(badge_file, sizeof(badge_file), "%s", badges->badge_id_list[i]);
|
||||||
char badge_file[bufferSize];
|
|
||||||
|
|
||||||
snprintf(badge_file, bufferSize, "%s", badges->badge_id_list[i]);
|
|
||||||
strcat(badge_file, locked_suffix);
|
strcat(badge_file, locked_suffix);
|
||||||
|
|
||||||
fill_pathname_application_special(fullpath,
|
fill_pathname_application_special(fullpath,
|
||||||
|
|
Loading…
Reference in New Issue