Fix accessing cleared memory
Fixed a major bug whereby file names were being retrieved from a cleared pointer (issue 9). Tested working on n3DS. Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
@@ -131,14 +131,6 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(closedir(dp) != 0)
|
|
||||||
err_print("Closing directory failed.");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: There is an issue with Unicode files here.
|
|
||||||
* Playing a flac file then a file with a name containing the
|
|
||||||
* character 'é' will cause the asprint to not work properly.
|
|
||||||
*/
|
|
||||||
if(asprintf(&file, "%s%s", AUDIO_FOLDER, ep->d_name) == -1)
|
if(asprintf(&file, "%s%s", AUDIO_FOLDER, ep->d_name) == -1)
|
||||||
{
|
{
|
||||||
err_print("Constructing file name failed.");
|
err_print("Constructing file name failed.");
|
||||||
@@ -164,6 +156,9 @@ int main(int argc, char **argv)
|
|||||||
printf("Unsupported File type.\n");
|
printf("Unsupported File type.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(closedir(dp) != 0)
|
||||||
|
err_print("Closing directory failed.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
err_print("Unable to open directory.");
|
err_print("Unable to open directory.");
|
||||||
|
|||||||
Reference in New Issue
Block a user