1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-09-03 01:21:16 +03:00

Use correct type for pointer alignment

On 64bit systems casting to long may result in a truncation of data
resulting in an incorrect alignment
This commit is contained in:
Matt Clarkson
2015-05-22 13:41:52 +01:00
parent d8f7976560
commit d81258ce88

View File

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