aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2019-06-02 22:21:31 +0100
committerSteve Holme <steve_holme@hotmail.com>2019-06-04 01:30:16 +0100
commit3538026f6f145b2811f4d515992565d6cbe969b0 (patch)
treec7a3f7f570e9789824da66b9b5708467af1f74c3 /src
parent8c88e8e623777f2fe06f09b2966928b4ac70ad22 (diff)
tool_parsecfg: Use correct return type for GetModuleFileName()
GetModuleFileName() returns a DWORD which is a typedef of an unsigned long and not an int. Closes #3980
Diffstat (limited to 'src')
-rw-r--r--src/tool_parsecfg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c
index 621369d45..36c7bccf0 100644
--- a/src/tool_parsecfg.c
+++ b/src/tool_parsecfg.c
@@ -76,8 +76,9 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
* already declared via inclusions done in setup header file.
* We assume that we are using the ASCII version here.
*/
- int n = GetModuleFileNameA(0, filebuffer, sizeof(filebuffer));
- if(n > 0 && n < (int)sizeof(filebuffer)) {
+ unsigned long len = GetModuleFileNameA(0, filebuffer,
+ sizeof(filebuffer));
+ if(len > 0 && len < sizeof(filebuffer)) {
/* We got a valid filename - get the directory part */
char *lastdirchar = strrchr(filebuffer, '\\');
if(lastdirchar) {