mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Merge pull request #4596 from leiradel/master
Fixed crash in cheevos_get_description
This commit is contained in:
commit
8d2bafb279
@ -3227,15 +3227,23 @@ void cheevos_populate_menu(void *data, bool hardcore)
|
||||
|
||||
bool cheevos_get_description(cheevos_ctx_desc_t *desc)
|
||||
{
|
||||
cheevo_t *cheevos = cheevos_locals.core.cheevos;
|
||||
|
||||
if (desc->idx >= cheevos_locals.core.count)
|
||||
if (cheevos_loaded)
|
||||
{
|
||||
cheevos = cheevos_locals.unofficial.cheevos;
|
||||
desc->idx -= cheevos_locals.unofficial.count;
|
||||
}
|
||||
cheevo_t *cheevos = cheevos_locals.core.cheevos;
|
||||
|
||||
strlcpy(desc->s, cheevos[desc->idx].description, desc->len);
|
||||
if (desc->idx >= cheevos_locals.core.count)
|
||||
{
|
||||
cheevos = cheevos_locals.unofficial.cheevos;
|
||||
desc->idx -= cheevos_locals.unofficial.count;
|
||||
}
|
||||
|
||||
strlcpy(desc->s, cheevos[desc->idx].description, desc->len);
|
||||
}
|
||||
else
|
||||
{
|
||||
*desc->s = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user