From 13e2f8e9ede58f308a1e5f9ffe0da6780c2e12c0 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Fri, 6 Nov 2015 18:02:27 +0000 Subject: [PATCH] Fix #2210. Reverts from a0909a2 that cause the up button to load the same directory --- src/windows/loadsave.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'){