(Legacy Win32) Be more careful with retro_vfs_stat_impl

This commit is contained in:
twinaphex 2019-05-06 03:00:25 +02:00
parent 720ebc6834
commit 0919cd9746
2 changed files with 8 additions and 2 deletions

View File

@ -654,7 +654,12 @@ void path_basedir(char *path)
**/
void path_parent_dir(char *path)
{
size_t len = strlen(path);
size_t len = 0;
if (!path)
return;
len = strlen(path);
if (len && path_char_is_slash(path[len - 1]))
{

View File

@ -832,6 +832,7 @@ int retro_vfs_stat_impl(const char *path, int32_t *size)
path_local = utf8_to_local_string_alloc(path);
file_info = GetFileAttributes(path_local);
if (!string_is_empty(path_local))
_stat(path_local, &buf);
if (path_local)