소스 검색

Use correct type for pointer alignment

On 64bit systems casting to long may result in a truncation of data
resulting in an incorrect alignment
Matt Clarkson 10 년 전
부모
커밋
d81258ce88
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/main.c

+ 1 - 1
src/main.c

@@ -887,7 +887,7 @@ static void show_error(void)
 
 static void *align(void *ptr, DWORD alig)
 {
-	ULONG ul = (ULONG)ptr;
+	uintptr_t ul = (uintptr_t)ptr;
 	ul += alig;
 	ul &= ~alig;
 	return ((void *)ul);