Skip to content

Commit

Permalink
tool_parsecfg: Use correct return type for GetModuleFileName()
Browse files Browse the repository at this point in the history
GetModuleFileName() returns a DWORD which is a typedef of an unsigned
long and not an int.

Closes #3980
  • Loading branch information
captain-caveman2k committed Jun 4, 2019
1 parent 8c88e8e commit 3538026
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tool_parsecfg.c
Expand Up @@ -76,8 +76,9 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
* already declared via inclusions done in setup header file. * already declared via inclusions done in setup header file.
* We assume that we are using the ASCII version here. * We assume that we are using the ASCII version here.
*/ */
int n = GetModuleFileNameA(0, filebuffer, sizeof(filebuffer)); unsigned long len = GetModuleFileNameA(0, filebuffer,
if(n > 0 && n < (int)sizeof(filebuffer)) { sizeof(filebuffer));
if(len > 0 && len < sizeof(filebuffer)) {
/* We got a valid filename - get the directory part */ /* We got a valid filename - get the directory part */
char *lastdirchar = strrchr(filebuffer, '\\'); char *lastdirchar = strrchr(filebuffer, '\\');
if(lastdirchar) { if(lastdirchar) {
Expand Down

0 comments on commit 3538026

Please sign in to comment.