1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-05 09:05:04 -05:00

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
This commit is contained in:
Steve Holme 2019-06-02 22:21:31 +01:00
parent 8c88e8e623
commit 3538026f6f
No known key found for this signature in database
GPG Key ID: 4059CB85CA7E8F19

View File

@ -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) {