Fix warnings when building for WIN64

This commit is contained in:
Joseph C. Lehner 2024-11-26 22:26:45 +01:00
parent 3341e54222
commit 33beedb038

9
main.c
View file

@ -158,9 +158,6 @@ int main(int argc, char **argv)
.offset = 0, .offset = 0,
}; };
#ifdef NMRPFLASH_WINDOWS #ifdef NMRPFLASH_WINDOWS
char *newpath = NULL;
char *oldpath = NULL;
char *windir = NULL;
WSADATA wsa; WSADATA wsa;
atexit(&show_exit_prompt); atexit(&show_exit_prompt);
@ -183,10 +180,10 @@ int main(int argc, char **argv)
// //
// [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa384187(v=vs.85).aspx // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa384187(v=vs.85).aspx
oldpath = getenv("PATH"); char *oldpath = getenv("PATH");
windir = getenv("WINDIR"); char *windir = getenv("WINDIR");
if (oldpath && windir) { if (oldpath && windir) {
newpath = malloc(strlen(oldpath) + strlen(windir) + 32); char *newpath = malloc(strlen(oldpath) + strlen(windir) + 32);
sprintf(newpath, "%s;%s\\Sysnative", oldpath, windir); sprintf(newpath, "%s;%s\\Sysnative", oldpath, windir);
SetEnvironmentVariable("PATH", newpath); SetEnvironmentVariable("PATH", newpath);
free(newpath); free(newpath);