Explorar o código

Cast the process id

GetProcessId returns a DWORD (which is unsigned) and the HighPart or a
LARGE_INTEGER is a LONG (which is signed). As we are just doing some
hashing it is fine to cast this.
Matt Clarkson %!s(int64=10) %!d(string=hai) anos
pai
achega
798e808e2b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/main.c

+ 1 - 1
src/main.c

@@ -1136,7 +1136,7 @@ static void suggest_passwd(char *passwd)
 
 	/* valid characters are 32 to 126 */
 	GetSystemTimeAsFileTime(&num.ft);
-	num.li.HighPart |= GetCurrentProcessId();
+	num.li.HighPart |= (LONG)GetCurrentProcessId();
 	p = passwd;
 	while (num.li.QuadPart) {
 		u = (unsigned)(num.li.QuadPart % 95);