diff options
author | Arisotura <thetotalworm@gmail.com> | 2020-05-17 14:23:06 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2020-05-17 14:23:06 +0200 |
commit | c9a76edf210410dbf95d100690bad9c86aa5bd84 (patch) | |
tree | 6d0312bd58e6daa77132bfed2f0bb5d63bc2b616 /src/frontend/qt_sdl/main.cpp | |
parent | 0566c9e34c36f7f1841765b02147fd4c890e8550 (diff) |
probably fix some pretty bad issue
good one, Generic
Diffstat (limited to 'src/frontend/qt_sdl/main.cpp')
-rw-r--r-- | src/frontend/qt_sdl/main.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 67eb3d8..a7388a0 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -888,9 +888,12 @@ int main(int argc, char** argv) #else const char* confdir = g_get_user_config_dir(); const char* confname = "/melonDS"; - EmuDirectory = new char[strlen(confdir) + strlen(confname) + 1]; - strcat(EmuDirectory, confdir); - strcat(EmuDirectory, confname); + int cdlen = strlen(confdir); + int cnlen = strlen(confname); + EmuDirectory = new char[cdlen + cnlen + 1]; + strncpy(&EmuDirectory[0], confdir, cdlen); + strncpy(&EmuDirectory[cdlen], confname, cnlen); + EmuDirectory[cdlen+cnlen] = '\0'; #endif QApplication melon(argc, argv); |