mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-17 16:10:29 +00:00
fixed cheevos_get_value when the key isn't found
This commit is contained in:
parent
14dde87e7b
commit
045c576729
@ -309,10 +309,11 @@ static int cheevos_get_value(const char *json, unsigned key_hash, char *value, s
|
||||
|
||||
ud.key_hash = key_hash;
|
||||
ud.is_key = 0;
|
||||
ud.value = NULL;
|
||||
ud.length = 0;
|
||||
*value = 0;
|
||||
|
||||
if (jsonsax_parse(json, &handlers, (void*)&ud) == JSONSAX_OK && ud.length < length)
|
||||
if (jsonsax_parse(json, &handlers, (void*)&ud) == JSONSAX_OK && ud.value && ud.length < length)
|
||||
{
|
||||
strncpy(value, ud.value, length);
|
||||
value[ud.length] = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user