This commit is contained in:
Rajko Stojadinovic 2018-07-25 02:06:11 +00:00 committed by GitHub
commit 6f8c529d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,8 +103,13 @@ int menuScan(const char* target) {
bool entrytype=0; bool entrytype=0;
memset(tmp_path, 0, sizeof(tmp_path)); size_t pathLen = strlen(s_menu[!s_curMenu].dirname);
snprintf(tmp_path, sizeof(tmp_path)-1, "%s/%s", s_menu[!s_curMenu].dirname, dp->d_name); strncpy(tmp_path, s_menu[!s_curMenu].dirname, sizeof(tmp_path));
if (pathLen > 0 && tmp_path[pathLen-1] != '/') {
tmp_path[pathLen++] = '/';
tmp_path[pathLen] = 0;
}
strncpy(&tmp_path[pathLen], dp->d_name, sizeof(tmp_path)-pathLen-1);
#ifdef __SWITCH__ #ifdef __SWITCH__
fsdev_dir_t* dirSt = (fsdev_dir_t*)dir->dirData->dirStruct; fsdev_dir_t* dirSt = (fsdev_dir_t*)dir->dirData->dirStruct;