From 3a7b91a5fe0968ac72e1f8a65c0a4d98c1a6f50d Mon Sep 17 00:00:00 2001 From: Epicpkmn11 <41608708+Epicpkmn11@users.noreply.github.com> Date: Sun, 28 Oct 2018 18:44:11 -0500 Subject: [PATCH] Change iscanf() to fgets() for renaming files and creating folders (Fixes #20) (#21) * Change iscanf() to fgets() to fix Issue #20 * Actually change it correctly * Fix new line being at the end on the input --- arm9/source/file_browse.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arm9/source/file_browse.cpp b/arm9/source/file_browse.cpp index 8b04c81..8947b21 100644 --- a/arm9/source/file_browse.cpp +++ b/arm9/source/file_browse.cpp @@ -562,7 +562,8 @@ string browseForFile (void) { keyboardShow(); printf("Rename to: \n"); - iscanf("%s", newName); + fgets(newName, 256, stdin); + newName[strlen(newName)-1] = 0; keyboardHide(); consoleClear(); @@ -623,7 +624,8 @@ string browseForFile (void) { keyboardShow(); printf("Name for new folder: \n"); - iscanf("%s", newName); + fgets(newName, 256, stdin); + newName[strlen(newName)-1] = 0; keyboardHide(); consoleClear();