Get rid of variable-length array

This commit is contained in:
twinaphex 2017-12-30 08:09:35 +01:00
parent f63385de08
commit 794de84961

View File

@ -18,15 +18,12 @@ bool badge_exists(const char* filepath)
void set_badge_menu_texture(badges_ctx_t * badges, int i)
{
char badge_file[16];
char fullpath[PATH_MAX_LENGTH];
const char * locked_suffix = (badges->badge_locked[i] == true)
? "_lock.png" : ".png";
unsigned int bufferSize = 16;
/* TODO/FIXME - variable length forbidden in C89 - rewrite this! */
char badge_file[bufferSize];
snprintf(badge_file, bufferSize, "%s", badges->badge_id_list[i]);
snprintf(badge_file, sizeof(badge_file), "%s", badges->badge_id_list[i]);
strcat(badge_file, locked_suffix);
fill_pathname_application_special(fullpath,