Fix missing NUL terminator.

This commit is contained in:
Alcaro 2015-05-19 21:59:36 +02:00
parent 3c7e0b29fc
commit 964c2439ff
2 changed files with 3 additions and 1 deletions

View File

@ -729,6 +729,7 @@ enum retro_mod
* location-based information from the host device,
* such as current latitude / longitude.
*/
#define RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY 30 /* Old name, kept for compatibility. */
#define RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY 30
/* const char ** --
* Returns the "core assets" directory of the frontend.

View File

@ -227,12 +227,13 @@ int cb_core_updater_list(void *data_, size_t len)
if (core_buf)
free(core_buf);
core_buf = (char*)malloc(len * sizeof(char));
core_buf = (char*)malloc((len+1) * sizeof(char));
if (!core_buf)
return -1;
memcpy(core_buf, data, len * sizeof(char));
core_buf[len] = '\0';
core_len = len;
menu->nonblocking_refresh = false;