Eric Pouech : msvcrt: Use the parameter checking macros for strncpy_s.

Alexandre Julliard julliard at winehq.org
Mon Nov 1 11:54:34 CDT 2010


Module: wine
Branch: master
Commit: c10a6d74d5a0df8dce3e54dec2ae98706c9b8d1d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c10a6d74d5a0df8dce3e54dec2ae98706c9b8d1d

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Fri Oct 29 15:39:03 2010 +0200

msvcrt: Use the parameter checking macros for strncpy_s.

---

 dlls/msvcrt/heap.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/heap.c b/dlls/msvcrt/heap.c
index b1d4076..548dd82 100644
--- a/dlls/msvcrt/heap.c
+++ b/dlls/msvcrt/heap.c
@@ -572,8 +572,7 @@ int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements,
     if(!count)
         return 0;
 
-    if(!dest || !src || !numberOfElements) {
-        MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
+    if (!MSVCRT_CHECK_PMT(dest != NULL) || !MSVCRT_CHECK_PMT(src != NULL) || !MSVCRT_CHECK_PMT(numberOfElements != 0)) {
         *MSVCRT__errno() = MSVCRT_EINVAL;
         return MSVCRT_EINVAL;
     }
@@ -591,7 +590,7 @@ int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements,
         return 0;
     }
 
-    MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
+    MSVCRT_INVALID_PMT("dest[numberOfElements] is too small");
     dest[0] = '\0';
     *MSVCRT__errno() = MSVCRT_EINVAL;
     return MSVCRT_EINVAL;




More information about the wine-cvs mailing list