Closed Xottab-DUTY closed 7 months ago
@AMS21, could you look?
I've tried to replicate this but it works as expected on my machine. From what I've gathered while looking at the code I would assume that for some reason Core.UserName
contains a trailing backslash as I can replicate this behavior by hard coding the name like this
diff --git a/src/xrCore/xrCore.cpp b/src/xrCore/xrCore.cpp
index bf0389127..395075f59 100644
--- a/src/xrCore/xrCore.cpp
+++ b/src/xrCore/xrCore.cpp
@@ -228,7 +228,7 @@ void xrCore::Initialize(pcstr _ApplicationName, pcstr commandLine, LogCallback c
struct passwd *pw = getpwuid(uid);
if(pw)
{
- strcpy(UserName, pw->pw_gecos);
+ strcpy(UserName, "lucy\\");
char* pos = strchr(UserName, ','); // pw_gecos return string
if(NULL != pos)
*pos = 0;
What I'm not sure how this backslash got in there in the first place, since I don't believe having a backslash in your username is allowed but I might be wrong here.
If that's the case one potential fix could be after setting UserName
to go and replace all backslashes or other problematic characters with _
.
I also notices that since we are using strcpy
you could potentially overflow the buffer by having a username which is longer than 64 characters, which could easily be fixed by using strncpy
.
In theory, this is fixed. We can reopen if it's not.
Describe the bug When you use a quick save, the file name is
<system name> - quicksave.<fmt>
, where \<system name> is the user profile name in the OS and \<fmt> is file format – eitherscop
orsav
.For some reason, when we try to save a file with path
game folder/_appdata_/savedgames/user - quicksave.scop
, the result appears to begame folder/_appdata_/gamesaves/user/- quicksave.scop
– it creates a subfolder.To Reproduce Steps to reproduce the behavior:
Expected behavior Quick saves should be saved into savedgames folder normally.
Screenshots, videos
Desktop (please complete the following information):
Additional context Look at function
CALifeStorageManager::save
inxrGame/alife_storage_manager.cpp