msvcrt: Fix incorrect uses of msvcrt_set_errno.
This commit is contained in:
parent
1bbac341df
commit
a470afca6c
|
@ -280,7 +280,7 @@ void* CDECL MSVCRT_malloc(MSVCRT_size_t size)
|
|||
{
|
||||
void *ret = HeapAlloc(GetProcessHeap(),0,size);
|
||||
if (!ret)
|
||||
msvcrt_set_errno(MSVCRT_ENOMEM);
|
||||
*MSVCRT__errno() = MSVCRT_ENOMEM;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -348,14 +348,14 @@ void * CDECL _aligned_offset_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment,
|
|||
/* alignment must be a power of 2 */
|
||||
if ((alignment & (alignment - 1)) != 0)
|
||||
{
|
||||
msvcrt_set_errno(EINVAL);
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* offset must be less than size */
|
||||
if (offset >= size)
|
||||
{
|
||||
msvcrt_set_errno(EINVAL);
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -405,14 +405,14 @@ void * CDECL _aligned_offset_realloc(void *memblock, MSVCRT_size_t size,
|
|||
/* alignment must be a power of 2 */
|
||||
if ((alignment & (alignment - 1)) != 0)
|
||||
{
|
||||
msvcrt_set_errno(EINVAL);
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* offset must be less than size */
|
||||
if (offset >= size)
|
||||
{
|
||||
msvcrt_set_errno(EINVAL);
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -430,7 +430,7 @@ void * CDECL _aligned_offset_realloc(void *memblock, MSVCRT_size_t size,
|
|||
saved = SAVED_PTR(memblock);
|
||||
if (memblock != ALIGN_PTR(*saved, alignment, offset))
|
||||
{
|
||||
msvcrt_set_errno(EINVAL);
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ int CDECL _setmbcp(int cp)
|
|||
if (!GetCPInfo(newcp, &cpi))
|
||||
{
|
||||
WARN("Codepage %d not found\n", newcp);
|
||||
msvcrt_set_errno(MSVCRT_EINVAL);
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue