diff options
author | Rr42 | 2018-06-20 11:56:16 +0530 |
---|---|---|
committer | Rr42 | 2018-06-20 11:56:16 +0530 |
commit | 940b1617d158f24abfbc5c5f6e541ae6136b4347 (patch) | |
tree | ae7ce1c8105f5117cb36f8d184cd20a023b0ddb7 | |
parent | e0dee2ff8d0a6d74f6a07ff73d739d3ac6fd6b22 (diff) | |
download | LDMicroGtk-940b1617d158f24abfbc5c5f6e541ae6136b4347.tar.gz LDMicroGtk-940b1617d158f24abfbc5c5f6e541ae6136b4347.tar.bz2 LDMicroGtk-940b1617d158f24abfbc5c5f6e541ae6136b4347.zip |
Update to freeze library, fixes a bug where CWD was not set properly.
-rw-r--r-- | ldmicro/lib/freezeLD/freezeLD.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ldmicro/lib/freezeLD/freezeLD.cpp b/ldmicro/lib/freezeLD/freezeLD.cpp index 880dfab..b9cafb2 100644 --- a/ldmicro/lib/freezeLD/freezeLD.cpp +++ b/ldmicro/lib/freezeLD/freezeLD.cpp @@ -20,8 +20,8 @@ void FreezeWindowPosF(HWID hwid, char *subKey, char *name) { //g_print("freezing"); char* Ld_CWD = (char *)malloc(MAX_PATH); - getcwd(Ld_CWD, sizeof(Ld_CWD)); - + getcwd(Ld_CWD, MAX_PATH); + if (!Ld_CWD) return; char* moveToKeyLocatin = (char *)malloc(strlen(name) + MAX_PATH); @@ -144,8 +144,8 @@ static void Clamp(LONG *v, LONG min, LONG max) void ThawWindowPosF(HWID hwid, char *subKey, char *name) { char* Ld_CWD = (char *)malloc(MAX_PATH); - getcwd(Ld_CWD, sizeof(Ld_CWD)); - + getcwd(Ld_CWD, MAX_PATH); + if (!Ld_CWD) return; @@ -254,7 +254,7 @@ void ThawWindowPosF(HWID hwid, char *subKey, char *name) void FreezeDWORDF(DWORD val, char *subKey, char *name) { char* Ld_CWD = (char *)malloc(MAX_PATH); - getcwd(Ld_CWD, sizeof(Ld_CWD)); + getcwd(Ld_CWD, MAX_PATH); if (!Ld_CWD) return; @@ -294,7 +294,7 @@ void FreezeDWORDF(DWORD val, char *subKey, char *name) DWORD ThawDWORDF(DWORD val, char *subKey, char *name) { char* Ld_CWD = (char *)malloc(MAX_PATH); - getcwd(Ld_CWD, sizeof(Ld_CWD)); + getcwd(Ld_CWD, MAX_PATH); if (!Ld_CWD) return val; @@ -339,7 +339,7 @@ DWORD ThawDWORDF(DWORD val, char *subKey, char *name) void FreezeStringF(char *val, char *subKey, char *name) { char* Ld_CWD = (char *)malloc(MAX_PATH); - getcwd(Ld_CWD, sizeof(Ld_CWD)); + getcwd(Ld_CWD, MAX_PATH); if (!Ld_CWD) return; @@ -377,7 +377,7 @@ void FreezeStringF(char *val, char *subKey, char *name) void ThawStringF(char *val, int max, char *subKey, char *name) { char* Ld_CWD = (char *)malloc(MAX_PATH); - getcwd(Ld_CWD, sizeof(Ld_CWD)); + getcwd(Ld_CWD, MAX_PATH); if (!Ld_CWD) return; |