diff --git a/src/windows/loadsave.c b/src/windows/loadsave.c index 78bbcc91fc..c3594396da 100644 --- a/src/windows/loadsave.c +++ b/src/windows/loadsave.c @@ -642,7 +642,8 @@ static void window_loadsave_populate_list(int includeNewItem, bool browsable, co if (!topLevel){ listItem = &_listItems[_listItemsCount]; safe_strncpy(listItem->name, language_get_string(2718), sizeof(listItem->name)); - safe_strncpy(listItem->path, directory, sizeof(listItem->path)); + memset(listItem->path, '\0', sizeof(listItem->path)); + strncpy(listItem->path, directory, lastSlash + 1); listItem->type = TYPE_UP; _listItemsCount++; } else if (platform_get_drives() != 0 && directory[0] != '\0'){