From a470afca6c045e5269aabedb57631eb9eb8512d8 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 27 Feb 2008 12:24:09 +0100 Subject: [PATCH] msvcrt: Fix incorrect uses of msvcrt_set_errno. --- dlls/msvcrt/heap.c | 12 ++++++------ dlls/msvcrt/mbcs.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/msvcrt/heap.c b/dlls/msvcrt/heap.c index 2f7fb9f3dde..227bc9176f2 100644 --- a/dlls/msvcrt/heap.c +++ b/dlls/msvcrt/heap.c @@ -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; } diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 14a962ace60..392f450b8cf 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -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; } -- 2.11.4.GIT