Skip to content

Commit 3538026

Browse files
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 curl#3980
1 parent 8c88e8e commit 3538026

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tool_parsecfg.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
7676
* already declared via inclusions done in setup header file.
7777
* We assume that we are using the ASCII version here.
7878
*/
79-
int n = GetModuleFileNameA(0, filebuffer, sizeof(filebuffer));
80-
if(n > 0 && n < (int)sizeof(filebuffer)) {
79+
unsigned long len = GetModuleFileNameA(0, filebuffer,
80+
sizeof(filebuffer));
81+
if(len > 0 && len < sizeof(filebuffer)) {
8182
/* We got a valid filename - get the directory part */
8283
char *lastdirchar = strrchr(filebuffer, '\\');
8384
if(lastdirchar) {

0 commit comments

Comments
 (0)