DXGL r785 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r784‎ | r785 | r786 >
Date:03:33, 24 February 2018
Author:admin
Status:new
Tags:
Comment:
Fix application profile registry path.
Modified paths:
  • /cfgmgr/cfgmgr.c (modified) (history)

Diff [purge]

Index: cfgmgr/cfgmgr.c
@@ -1104,17 +1104,18 @@
11051105 TCHAR sha256string[65];
11061106 FILE *file;
11071107 TCHAR filename[MAX_PATH+1];
 1108+ TCHAR regkey[MAX_PATH + 80];
11081109 int i;
11091110 BOOL DPIAwarePM = FALSE;
11101111 HMODULE hSHCore = NULL;
11111112 HMODULE hUser32 = NULL;
11121113 GetModuleFileName(NULL, filename, MAX_PATH);
1113 - _tcscpy(cfg->regkey, regkeybase);
1114 - _tcscat(cfg->regkey, _T("Profiles\\"));
 1114+ _tcscpy(regkey, regkeybase);
 1115+ _tcscat(regkey, _T("Profiles\\"));
11151116 for (i = _tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
11161117 i++;
1117 - _tcscat(cfg->regkey, &filename[i]);
1118 - _tcscat(cfg->regkey, _T("-"));
 1118+ _tcscat(regkey, &filename[i]);
 1119+ _tcscat(regkey, _T("-"));
11191120 i--;
11201121 filename[i] = 0;
11211122 _tcslwr(filename);
@@ -1127,8 +1128,9 @@
11281129 sha256string[(i * 2) + 1] = (TCHAR)hexdigit(sha256.bytes[i] & 0xF);
11291130 }
11301131 sha256string[256 / 4] = 0;
1131 - _tcscat(cfg->regkey, sha256string);
 1132+ _tcscat(regkey, sha256string);
11321133 GetGlobalConfig(cfg, initial);
 1134+ _tcscpy(cfg->regkey, regkey);
11331135 ReadINI(cfg);
11341136 if (cfg->OverrideDefaults)
11351137 {