More-accurate Profile.cpp variable arrangement

This commit is contained in:
Clownacy 2020-01-07 21:50:36 +00:00
parent 10a014dabd
commit 74cd1b0473

View file

@ -27,11 +27,9 @@ const char *gProfileCode = "Do041220";
BOOL IsProfile(void) BOOL IsProfile(void)
{ {
char path[MAX_PATH]; char path[MAX_PATH];
HANDLE hFile;
sprintf(path, "%s\\%s", gModulePath, gDefaultName); sprintf(path, "%s\\%s", gModulePath, gDefaultName);
hFile = CreateFileA(path, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE hFile = CreateFileA(path, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) if (hFile == INVALID_HANDLE_VALUE)
return FALSE; return FALSE;
@ -41,9 +39,10 @@ BOOL IsProfile(void)
BOOL SaveProfile(const char *name) BOOL SaveProfile(const char *name)
{ {
PROFILE profile;
FILE *fp; FILE *fp;
PROFILE profile;
const char *FLAG = "FLAG"; const char *FLAG = "FLAG";
char path[MAX_PATH]; char path[MAX_PATH];
// Get path // Get path
@ -89,9 +88,9 @@ BOOL SaveProfile(const char *name)
BOOL LoadProfile(const char *name) BOOL LoadProfile(const char *name)
{ {
char path[MAX_PATH];
PROFILE profile;
FILE *fp; FILE *fp;
PROFILE profile;
char path[MAX_PATH];
// Get path // Get path
if (name != NULL) if (name != NULL)