ref: 74cd1b047358e3c946fa6ac382ef97d06312c39d
parent: 10a014dabda1d525f0e51eef2084f268f33c046e
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Jan 7 16:50:36 EST 2020
More-accurate Profile.cpp variable arrangement
--- a/src/Profile.cpp
+++ b/src/Profile.cpp
@@ -27,11 +27,9 @@
BOOL IsProfile(void)
{
char path[MAX_PATH];
- HANDLE hFile;
-
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)
return FALSE;
@@ -41,9 +39,10 @@
BOOL SaveProfile(const char *name)
{
- PROFILE profile;
FILE *fp;
+ PROFILE profile;
const char *FLAG = "FLAG";
+
char path[MAX_PATH];
// Get path
@@ -89,9 +88,9 @@
BOOL LoadProfile(const char *name)
{
- char path[MAX_PATH];
- PROFILE profile;
FILE *fp;
+ PROFILE profile;
+ char path[MAX_PATH];
// Get path
if (name != NULL)