Merge pull request #337 from notaz/sram

Allow partial SRAM load
This commit is contained in:
Hans-Kristian Arntzen 2013-10-13 09:53:35 -07:00
commit ad3df7077c
1 changed files with 8 additions and 1 deletions

9
file.c
View File

@ -424,8 +424,15 @@ void load_ram_file(const char *path, int type)
void *buf = NULL;
ssize_t rc = read_file(path, &buf);
if (rc > 0 && rc <= (ssize_t)size)
if (rc > 0)
{
if (rc > (ssize_t)size)
{
RARCH_WARN("SRAM is larger than implementation expects, doing partial load.\n");
rc = size;
}
memcpy(data, buf, rc);
}
free(buf);
}